Skip to content

Instantly share code, notes, and snippets.

@shantanubhadoria
Created September 21, 2015 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shantanubhadoria/b135a961d31e0b760923 to your computer and use it in GitHub Desktop.
Save shantanubhadoria/b135a961d31e0b760923 to your computer and use it in GitHub Desktop.
Setting up PHP fast-cgi using upstart
#/etc/default/php-fastcgi
PHP5=/usr/bin/php5-cgi
FASTCGI_USER=www-data
FASTCGI_GROUP=www-data
ADDRESS=127.0.0.1
PORT=9000
CHILDREN=6
#/etc/init/php-fastcgi.conf
#
# php-fastcgi - PHP FastCGI
description "PHP FastCGI"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
pre-start script
test -x /usr/bin/php-cgi || { stop; exit 0; }
test -f /etc/default/php-fastcgi || { stop; exit 0; }
end script
respawn
script
. /etc/default/php-fastcgi
exec /usr/bin/spawn-fcgi \
-n \
-a $ADDRESS \
-p $PORT \
-C $CHILDREN \
-u $FASTCGI_USER \
-g $FASTCGI_GROUP \
-f $PHP5
end script
@shantanubhadoria
Copy link
Author

Copied from https://gist.github.com/osantana/996287
Fixed minor errors in the files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment