Merely installing PHP5 causes my AWS Ubuntu server to die minutes later from a massive CPU spike
- by Mark Amery
I have an AWS server with Ubuntu 11.04 as the OS that is running an Apache2 webserver (incidentally Python-based and using Django).
We recently needed to add support for php5 to let us use a third party PHP library (incidentally for serving minified versions of js and css files).
However, for no reason any of us can discern, if we simply run
sudo apt-get install php5
on the server, then the install appears to finish successfully but, without us taking any further action (including not yet running sudo apt-get install libapache2-mod-php5, which I think would be the next step for us if everything worked), or actually running any PHP scripts on the server, a few minutes later the server becomes impossible to connect to, and looking at the 'Monitoring' tab for the server in the EC2 Management Console reveals that a while after the installation, CPU usage spikes to 100% and stays there permanently (until we reboot the server from the AWS Console). After rebooting, the server also reliably dies within a few (between 0 and 10) minutes.
We restored the server to a pre-PHP state from an AMI Image, observed that it was stable, and then tried installing PHP5 again and observed the server die in exactly the same way, so we're pretty much certain that installing PHP5 is what causes the symptoms.
What on earth could be causing this behaviour, and how can we get PHP installed on the server without it dying?