Thanks to a messed up vm, I am migrating my dev to a new 10.04 ubuntu vm (which is great since I can now move away from 8.04 JEOS vms). I am taking this opportunity to move to php5.3 and nginx with php running as FCGI where possible.
I have in my previous posts talked about how to compile and patch php to get the php-fpm interface, however manually starting it with every-reboot can be a pain, so here’s the upstart script for it.
Create a new file /etc/init/php-fpm and past the following contents inside it:
description "PHP FastCGI Process Manager"
start on {net-device-up and local-filesystems}
stop on runlevel [016]
expect fork
respawn
exec /usr/sbin/php-fpm --fpm-config /etc/php/php-fpm.conf
Obviously tweak the path and configuration to your hearts content. Hope this will help someone who is lazy like me and doesn’t like writing the same commands over and over again.
Also to start the service then, run the following command:
$ sudo initctl start php-fpm
