PHP 7 and CakePHP 2.8

Hi all

My name is toby and I’ve been coding in cakephp pretty much since the beginning. Certainly on cake 1.1.x.

Anyhow, we’re hosting on Amazon servers and the site gets something like 16,000,000 page impressions per month on around 9 servers running PHP 5.6

We’ve upgraded the PHP 7 branch of the site to cakephp 2.8.8 and PHP 7 to the latest (7.0.11). And it’s fast. Super fast.

We introduced a few PHP7 servers into the load balancer to see what happened. PHP7 servers are running at 20-40% CPU and handling around 3-4 times more traffic than the others. Except when they crash.

It seems to be that sometimes, the compiler corrupts some of the code, so that the Model is now looking for table foo^bar rather than the table foo_bar, or that a model will now be called Fo¨bar.

And then the server starts behaving really strangely - 500 errors sent by cakephp, but recorded on the server as a valid response and no error log.

I mean it all sounds like PHP 7 is at fault here and only when the servers are really pumping out responses, but has anyone seen this before? Anything at all?

Would really appreciate anyone’s thoughts.

So far these are the ideas we’ve got:

reduce the size of the instances so that they have to try less hard before help is called

fine tune the php.ini settings and nginx settings (already done as much as we can here)

upgrade to cake 3 (not too keen on this as we have around 600,000 lines of code to go through, so would like this to coincide with a site redesign/refresh)

Err, that’s it…

If you can think of anything that we haven’t thought of, it would really help a brother out.

oh bejesus, I thought ‘#’ was a list

oh and when I said 16,000,000 I meant 160,000,000 - it’s busy