PHP5-FPM does not create unix socket directory within /var/run
-
As you probably already discovered, /var/run is ephemeral by design. Check the FHS for more information on it and other directories.
-
The /var/run/php5-fpm directory must exist prior to php-fpm trying to use. Neither php-fpm nor the init script seem to be creating it so you'll have to step in.
The easiest option is to tweak your init script to create the directory in a way that is very specific to your environment. The downside is that this adds baggage that you'll have to carry on in your "sysadmin toolkit".
There are two other options that are more involved but would be permanent solutions for you and others:
-
Submit a patch to php-fpm source code so that it checks for the existence of the directory defined in the .conf files. This will require knowledge of C and PHP's processes for patch submission.
-
Submit a patch to your Linux distribution's init system so it does the same. This could be easier (compared to first option) and will probably require knowledge of shell script and again, your distro's processes for patch submission.
You can do the quick fix (change your init scripts) and move on, but a nice exercise would be to follow one of the permanent options so others can benefit. It's simple enough and might get you hooked on contributing to open source projects (if you don't already do it, pardon my ignorance).