Ubuntu 12.04 x64 ~ LEMP+WordPress: PHP keeps crashing

  • Posted October 28, 2013

Hi folks,

I’m running a 512MB RAM droplet with 2 separate single WP installs. Both vhost configs are identical. One of them is very new with just 6 posts so far. The other has been around since Dec '12.

I need some help here. For the life of me, I can’t figure out why PHP keeps crashing. I had the same problem with PHP5.3 + APC. Now I’m on PHP5.5 with ZendOpcache. I have to keep checking my site every now and then and login via SSH to restart PHP. Doesn’t sound right to me.

i. repository ppa:ondrej/php5 ii. repository ppa:nginx/stable

If someone could take a look at my configs and let me know what’s not right, will be greatly appreciated. I’m new to VPS have moved from a cPanel Shared Hosting. I like to seed now and hate to return to shared hosting should things not work out for me.

  1. /etc/nginx/nginx.conf:
  2. /etc/nginx/sites-available/mydomain:
  3. /etc/php5/fpm/php.ini:

I’m prepared to move the newer WP install to a shared host if required. I am currently not running W3TC or CloudFlare. I reckon I should be sorting out the crashing PHP before all else.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Sweet! :]

Guys, thanks for the help. PHP seems to be holding with Varnish installed.

You can just browse to http://yourip:nginxport

@Kamal, yeah I could do that. Erm, noob question. How do I temporarily switch off varnish for the test?

Varnish acts as a reverse proxy and does not affect php5-fpm’s behavior at all. You can upgrade your droplet temporarily and see if that fixes it. Since billing is hourly it will cost you next to nothing :]

@Kamal. Thanks for your input. I actually set ZendOpcache to 192MB and installed Varnish as suggested by Pablo. Seems like PHP is holding and hasn’t crashed. <br> <br>Does Varnish stop WordPress/PHP from caching? If so. does that mean my FastCGI settings are messed up in the first place? <br> <br>Be great if some could take a look at my configs and let me know if something is out of place. I haven’t installed swap yet. Upgrading is a possibility I guess but be silly if PHP still crashes after that…

@Nicholas: I don’t recommend doing that on a 512MB droplet. 256MB of free RAM isn’t enough for MySQL – it’ll crash. Try adding swap and/or upgrading your droplet.

If it’s performance you’re interested in, you may want to check out <a href=“”>How To Install Wordpress, Nginx, PHP, and Varnish on Ubuntu 12.04</a>.

Hi Pablo, not yet but I will look into that. I have up the ZendOpcache memory from 128M default to 256M. It’s probably gonna delay the issue at best I think.

Have you installed swap (MySQL eats up a lot of resources)? If not, check out <a href=“”>How To Add Swap on Ubuntu 12.04</a>.