Nginx, PHP and a PHP FastCGI daemon init script

In: Open Source|Operating Systems|Ruby on Rails

11 Jun 2007

One of the things us ex-Apache httpd or ex-Lighttpd users have to get used to when installing nginx is how there isn’t built-in FastCGI support for process spawning. While these means nginx is more lightweight and faster, it does mean that you have to manage your FastCGI processes yourself.

Having just upgraded to Ubuntu Feisty Fawn, I set to installing nginx and tried to get WordPress (which needs PHP, of course) running on it. Thanks to the new nginx package in the Feisty universe repository, getting nginx up and PHP (CGI version) and running is really straightforward. There’re lots of tutorials to help you out as well.

So that’s that. The part that bugged me though, was how the tutorials always provided a script to start your PHP FastCGI processes, but never provided a way to ensure your FastCGI processes started up on a reboot (i.e. an init script). Once again, Google doesn’t disappoint, turning up this php-cgi init script. Tweak the init script a little, put it in /etc/init.d/php-fastcgi, sudo chmod +x /etc/init.d/php-fastcgi, run sudo update-rc.d php-fastcgi defaults and place the configuration for the script in /etc/default/php-fastcgi, and you’re done. You now have a PHP FastCGI init script that spawns and kills your PHP FastCGI processes.

Note: Lighttpd does come with a spawn-fcgi binary that does the same, but I’m having trouble finding a suitable init script for spawn-fcgi (only the Gentoo emerge seems to have the init script). Still, this script works and I didn’t really want to install lightty on my starving VPS.

The init script: /etc/init.d/php-fastcgi

#! /bin/sh
### BEGIN INIT INFO
# Provides:          php-fastcgi
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description:       Start and stop php-cgi in external FASTCGI mode
### END INIT INFO

# Author: Kurt Zankl <[EMAIL PROTECTED]>

# Do NOT "set -e"

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="php-cgi in external FASTCGI mode"
NAME=php-fastcgi
DAEMON=/usr/bin/php-cgi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
PHP_CONFIG_FILE=/etc/php5/cgi/php.ini

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

# If the daemon is not enabled, give the user a warning and then exit,
# unless we are stopping the daemon
if [ "$START" != "yes" -a "$1" != "stop" ]; then
        log_warning_msg "To enable $NAME, edit /etc/default/$NAME and set START=yes"
        exit 0
fi

# Process configuration
export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS
DAEMON_ARGS="-q -b $FCGI_HOST:$FCGI_PORT -c $PHP_CONFIG_FILE"


do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
                || return 1
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
                --background --make-pidfile --chuid $EXEC_AS_USER --startas $DAEMON -- \
                $DAEMON_ARGS \
                || return 2
}

do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE > /dev/null # --name $DAEMON
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2
        # Wait for children to finish too if this is a daemon that forks
        # and if the daemon is only ever run from this initscript.
        # If the above conditions are not satisfied then add some other code
        # that waits for the process to drop all resources that could be
        # needed by services started subsequently.  A last resort is to
        # sleep for some time.
        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
        [ "$?" = 2 ] && return 2
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
        return "$RETVAL"
}
case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  restart|force-reload)
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac

Config file for init script (the init script looks for this): /etc/default/php-fastcgi

START=yes

# Which user runs PHP? (default: www-data)

EXEC_AS_USER=www-data

# Host and TCP port for FASTCGI-Listener (default: localhost:9000)

FCGI_HOST=localhost
FCGI_PORT=9000

# Environment variables, which are processed by PHP

PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000

nginx config file: /etc/nginx/nginx.conf

location ~ \.php$ {
  fastcgi_pass   127.0.0.1:9000;
  fastcgi_index  index.php;
  fastcgi_param  SCRIPT_FILENAME  /var/www/blog.codefront.net$fastcgi_script_name;
  include        /etc/nginx/fastcgi.conf;
}

My fastcgi.conf file (I’m not sure I need everything here…)

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

41 Responses to Nginx, PHP and a PHP FastCGI daemon init script

Avatar

links for 2007-06-13 « Bloggitation

June 13th, 2007 at 8am

[...] Nginx, PHP and a PHP FastCGI daemon init script (tags: php web nginx fastcgi sysadmin) [...]

Avatar

Shannon -jj Behrens

June 14th, 2007 at 3pm

I haven’t gotten it working yet, but I can make a couple corrections:

It’s not “/etc/defaults/php-fascgi”, it’s “/etc/default/php-fascgi”.

Beware when copying and pasting the above scripts. Double quotes and double hyphens get all messed up.

I’m currently stuck at “/etc/init.d/php-fastcgi start”. It’s just freezing without an error messages.

Avatar

Chu Yeow

June 14th, 2007 at 3pm

Thanks for the corrections. I’ve fixed the typo, though I can’t figure out how to stop WordPress from “correcting” the quotes and hyphens in the code.

So it’s just freezing and you have to kill the script? It’s possible with the double hyphens and quotes madness there was a typo somewhere.

Avatar

David Currie » Blog Archive » Changing servers

July 14th, 2007 at 1am

[...] So, it’s been a little bit quiet on this blog for the past few days. The main reason is that it’s been on the move from the hosting provided by our ISP (PlusNet) to my SliceHost slice. Things would have been much quicker had I not decided to switch Apache for the increasingly popular (due to its low memory usage) nginx. As is the beauty of a virtual server, with the click of a mouse I had a clean Dapper Drake install to start with. Rather than install nginx from source, I decided to upgrade to Feisty Fawn and install via apt. This means losing the long term support of Dapper but, hey, its my server and I’ll just have to upgrade again when necessary. From there, getting an nginx, mysql, Rails and PHP setup is well documented, on top of which I added an init script for FastCGI. [...]

Avatar

Brian Acheson

July 22nd, 2007 at 6am

Does a Fedora/RH equivalent of this script exist? I’ve been tweaking this to get it working on my Fedora machine, but have not had luck yet.

Thanks,
Brian

Avatar

lejeczek

August 16th, 2007 at 8pm

yes, fedora does have it, you could try: lighttpd-fastcgi it should give desired effects.

Avatar

mike503

August 21st, 2007 at 8am

i actually use ubuntu’s “upstart” init replacement, and spawn-fcgi from lighttpd


start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on shutdown

env PHP_FCGI_MAX_REQUESTS=125

respawn
exec /usr/bin/spawn-fcgi -u user -g group -C 5 -n -a 127.0.0.1 -p 1234 -f /usr/local/bin/php-cgi

then you can use “start $job” “stop $job” when you need it, and add that to your init script for starting/stopping the webserver (start engines prior to webserver starting, end engines after webserver ends)

works for me so far…

Avatar

osiris

August 28th, 2007 at 12am

hi,

difficult to make your scrip work. after correcting the quotes i have that new one:

/etc/init.d/php-fastcgi: 55: Syntax error: “||” unexpected. could you post a link to the raw script as .txt for instance? would be great. thank you

Avatar

Gerry Kirk

August 31st, 2007 at 9pm

Go to this page to download the script files above. Just follow the instructions step by step.

Avatar

Here be dragons » Blog Archive » Nginx, fastcgi and wordpress ubuntu feisty

November 21st, 2007 at 8am

[...] relied on a number of helpful tutorials, none of which was a complete solution, so I figured as an opening offering I [...]

Avatar

Here With Me sur son nouveau serveur ! | Here With Me

December 3rd, 2007 at 4am

[...] Tuto pour installer et configurer PHP5 via FastCGI avec Nginx [...]

Avatar

Nginx with PHP as FastCGI on Gentoo Linux | Tummblr

December 8th, 2007 at 11am

[...] Nginx, PHP and a PHP FastCGI daemon init script [...]

Avatar

Mandarin Soda » Blog Archive » Wordpress, PHP, Fastcgi, Nginx on Slicehost Sub-Domain

December 14th, 2007 at 4am

[...] Referenced: Primary Secondary Daemon script Nginx [...]

Avatar

nginx + PHP + FastCGI???????? « ???

January 14th, 2008 at 1pm

[...] >Nginx, PHP and a PHP FastCGI daemon init script [...]

Avatar

Setup nginx for php and rails on Ubuntu Gutsy 7.10 » Big Blue Web Development

January 24th, 2008 at 8pm

[...] Redemption in a Blog – Nginx, PHP and a PHP FastCGI daemon init script [...]

Avatar

~~????~~ » Blog Archive » Nginx???

January 26th, 2008 at 9pm

[...] Nginx, PHP and a PHP FastCGI daemon init script (with init script for PHP FastCGI) [...]

Avatar

Installing nginx and PHP with FastCGI on Mac OS X 10.5 (Leopard) | Stephen Tudor

April 3rd, 2008 at 11am

[...] Chu Yeow, who listed some awesome nginx config file examples. [...]

Avatar

Nginx, PHP and a PHP FastCGI daemon init script

May 8th, 2008 at 10pm

[...] Nginx, PHP and a PHP FastCGI daemon init script 2008-05-08 | 10:34 ?????Nginx | ???FastCGI | Nginx, PHP and a PHP FastCGI daemon init script [...]

Avatar

Where’s Lou » Blog Archive » Using NginX on Slicehost to save money

May 11th, 2008 at 8am

[...] Nginx, PHP and a PHP FastCGI daemon init script [...]

Avatar

Nginx (”engine x”) ??? HTTP ??? | ????

January 1st, 2009 at 9pm

[...] Nginx, PHP and a PHP FastCGI daemon init script (with init script for PHP FastCGI) [...]

Avatar

[CentOS]Script init.d non trova /libs/init/vars.sh - Forum Per Webmaster - Tutti Per Uno

January 5th, 2009 at 9pm

[...] init.d non trova /libs/init/vars.sh Salve vorrei utilizzare questo script per far partire all’avvio la versione fastcgi di php solo che l’esecuzione su CentOS si blocca [...]

Avatar

Matthew Helmke (dot) Net » Blog Archive » A short how-to for switching from Apache to nginx

January 9th, 2009 at 12am

[...] that, I used the php-fastcgi script I found here and put it in [...]

Avatar

APACHE ADMIN NOTES: RAW PERFORMANCE NUMBERS | Ryan McKern

January 16th, 2009 at 5am

[...] is due. I couldn’t have started to work out the nginx fastcgi configuration without help from this post on redemption in a blog. ↩ Tags: apache, benchmarks, http, lighttpd, nginx Comment [...]

Avatar

kb.hurricane-ridge.com / Bookmarks for January 19, 2009

January 20th, 2009 at 5am

[...] Nginx, PHP and a PHP FastCGI daemon init script | redemption in a blog – Example start/stop script for Nginx with PHP/FastCGI. Post a comment — Trackback URI RSS 2.0 feed for these comments This entry (permalink) was posted on Monday, January 19, 2009, at 1:10 pm by admin. Filed in Links. [...]

Avatar

From Apache to NGINX « Patrick O’Doherty

July 21st, 2009 at 11pm

[...] installed this along with another init.d script for Spawn-FCGI which I found over at Codefront.net. Once that was done it was a process of porting all my existing virtualhosts over to [...]

Avatar

links for 2009-08-26

August 27th, 2009 at 7am

[...] Nginx, PHP and a PHP FastCGI daemon init script | redemption in a blog (tags: nginx php fastcgi howto) [...]

Avatar

Setting up a LEMP Stack (Linux, Nginx, MySQL, PHP5) on Ubuntu 9.04 | chrisjohnston.org

November 29th, 2009 at 3am

[...] WikiNginx, PHP and a PHP FastCGI daemon init scriptInstalling Nginx With PHP5 And MySQL Support On Ubuntu [...]

Avatar

dizzy_wall — PHP 5.3.2 on nginx

May 19th, 2010 at 10am

[...] That web page will tell you to create two files. You must remember to chmod and register the init.d file so that it will start at boot. The following link is to a blog who used the above link as a source. In it are instructions for the chmoding and registering, if you aren’t up to speed on how to do it (http://blog.codefront.net/2007/06/11/nginx-php-and-a-php-fastcgi-daemon-init-script/). [...]

Avatar

Nginx | ?????linux???

August 9th, 2010 at 11am

[...] Nginx, PHP and a PHP FastCGI daemon init script (with init script for PHP FastCGI) [...]

Avatar

Christopher Arndt » Blog Archive » Tschüss Xmarks, hallo Firefox Sync! - Life of my Brain

September 30th, 2010 at 9am

[...] werden, dass PHP als FastCGI-Server gestartet werden kann. Ich benutze dazu das Init-Skript aus diesem Blogartikel. Der Einfachheit halber, stelle ich das Skript und die zugehörige Konfigurationsdatei, die in [...]

Avatar

nginx?php-cgi??????

November 6th, 2010 at 1pm

[...] ???????????????????????????????????????????????????????……orz [...]

Avatar

Building A Highly-Available Web Server Cluster | Ajitabh Pandey.Info

February 6th, 2011 at 4pm

[...] nginx, PHP and a PHP FastCGI daemon init script [...]

Avatar

Nginx?????Dabr? | apt-blog.net IT?????? PT??

March 1st, 2011 at 12am

[...] Recent Commentsmuxueqz on Vim??WordPress?? – VimRepressopenboy on Vim??WordPress?? – VimRepressGodaddy????? | ??????? on Ubuntu???Apache?.htaccess?????Felix Yan on OpenVPN???????DNS???Ubuntu uwsgi + nginx / bottle ??? | Felix's Blog on MoinMoin ? Nginx, fastcgi ? uwsgi ???Tags802.1x Arch AVR CET Debian EAP EAPOL Google Hack ibus Java Linux nginx Nokia plugin Python Scribefire Sogou Twitter Ubuntu Vim vimpress Web WordPress ?? ?? ??? ??? ?? ?? ??? ?? ??? ???? ?? ?? ?? ?? ???? ?? ??? ??? ?? ?? ??????Email or Gtalk: Google Friend ConnectMetaLog inEntries RSSComments RSSWordPress.orgNginx?????Dabr?September 27, 2010?????????????vps??????openvpn??????????????????????????????????????VPS???????????VPS?384M????????apache?????????????????nginx+fastcgi??????????????????nginx+fastcgi???WordPress???????????mysql?????????php-cgi??????????????????/etc/init.d/php-fastcgi?Nginx, PHP and a PHP FastCGI daemon init script????How to set up nginx with PHP on Ubuntu??????????????Unix Socket???nginx?fastcgi??????????lo interface????????Dabr?????????????????????SVN checkout??????? user_oauth.php????????common/user.php????????oauth??Twitter??????nginx???????????????????Showfom?Dabr?????????nginx????????????????wordpress????1 2 3 if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; }???????????????Setting????502?????error.log?????? 24219#0: *40 upstream sent too big header while reading response header from upstream ??Google?????????nginx?fastcgi????1 2 3 4 5 fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 128k;?????????????????????????Update:2010?????????itap??oauth?????itap?????????????????nginx?????????Location?? server { listen 80; ## listen for ipv4   server_name your.server.com; access_log /var/log/nginx/netputtweet.access.log; error_log /var/log/nginx/netputtweet.error.log;     root /var/www/netputweets/; index index.html index.htm index.php;   location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } }   location /oauthproxy/ { if (!-e $request_filename) { rewrite . /oauthproxy/index.php last; } }   location ~ .php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param HTTPS on; #if you use HTTPS fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } posted in Blogger Tech, Unix/Linux by BOYPT Follow comments via the RSS Feed | Leave a comment | Trackback URL2 Comments to "Nginx?????Dabr?"icyomik wrote:??????????????? ?????????????ReplyLink | September 27th, 2010 at 19:15BOYPT wrote:@icyomik: ???????????????????????????????????????????????????ReplyLink | September 28th, 2010 at 10:47Leave Your Comment Name (required) Mail (will not be published) (required) Website [...]

Avatar

????nginx+fastcgi???Wordpress??? | apt-blog.net IT?????? PT??

July 21st, 2011 at 7pm

[...] Recent Commentsbush on ??????????????????BOYPT on ????? MDS????Linux??tony on ????? MDS????Linux??zagfai on ????802.1x???C??????ubuntu ? iRedMail ? Nginx ??? – Antlite Works on MoinMoin ? Nginx, fastcgi ? uwsgi ???Tags802.1x Arch AVR Blog CET Debian EAP EAPOL Google Hack ibus Java Linux nginx Nokia plugin Python Scribefire Sogou Twitter Ubuntu Vim vimpress Web WordPress ?? ?? ??? ??? ?? ?? ??? ?? ??? ???? ?? ?? ?? ?? ???? ??? ??? ?? ?? ??????Email or Gtalk: Google Friend ConnectMetaLog inEntries RSSComments RSSWordPress.org????nginx+fastcgi???WordPress???July 24, 2009Update: nginx+php????????????????Nginx + PHP (via php-fpm) on Ubuntu ???????????LAMP Web?????nginx??Apache??????????????10???????PT???Arch??nginx???????wordpress???LNMP??????????nginx+fastcgi?????????????????apache+mod_cgi????nginx??????apache?????????[?]? Update?nginx+fastcgi???????????????vps?????????100M???apache?????????????????fcgi????worker?????nginx??????fastcgi??????????????????????PHP_FCGI_CHILDREN?????????????????????????????php-cgi?????nginx??????????Wordpress Cache??????64M?vps??????wordpress??????nginx? nginx??????????????1 /etc/rc.d/nginx start??nginx?????????????????????http://localhost????nginx???????????php ??php????????????php??arch wiki????????fcgi?????????1 cgi-fcgi -start -connect localhost:9000 /usr/bin/php-cginginx??????/srv/http/nginx????????index.php?????????1 2 3 <?php phpinfo(); ?>??????nginx??php??????????/etc/nginx/conf/nginx.conf ??nginx?????????????????????????? location ~ .php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } ????nginx1 /etc/rc.d/nginx restart????http://localhost/index.php??????php??????????index.php??????????????index  index.html index.htm;????index.php???MySQL??phpmyadmin ??mysql????1 /etc/rc.d/mysqld start???????mysql?root??????????? Arch???phpmyadmin????????/srv/http/phpMyAdmin??????phpmyadmin??????nginx????? #ln -s /srv/http/phpMyAdmin /srv/http/nginx/phpmyadmin ??????????nginx?????url?????????????????phpMyAdmin??????http://localhost/phpmyadmin?????????phpMyAdmin??????????phpmyadmin ??????????phpmyadmin????php?????MySQL???? ??/etc/php/php.ini???extension=mysql.so?????????????????? ?php-cgi kill??????cgi-fcgi?????http://localhost/phpmyadmin??????????????????mcrypt????????libmcrypt??/etc/php/php.ini???mcrypy.so????????php????????root???????????????wordpress???????????????????Wordpress 2.8.2????wp-config.php?ok??????????? ?????????????????????????????????????????????????????nginx???Apache?.htaccess??????/etc/nginx/conf/nginx.conf???????????????????????????????????????????????????????????????????????????????wp-syntax?????????????wp-syntax?????????????????php.ini???????????????32M??wp-syntax?????????php.ini????memory_limit??64M?????????? ???nginx???????????????????nginx.conf???????????????????????????????????nginx.conf?? ???????????????????????????HTTP HEAD??????????????localhost?????????????????????/etc/hosts???????????????????127.0.0.1 ptblog.localdomain ptblog?????????????http://ptblog????????????????ptblog.com?????……?? nginx.conf???????????? http { …. server { …….. } server { …….. } } ??????????????????????????nginx?http?????????????????????server???????listen?web??????????80??????server_name??????????????????server????server_name???????root???????????????????????server? server { listen 80; server_name ptblog ptblog.localdomain; root /srv/http/nginx/ptblog/; location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = 50x.html { root /srv/http/nginx/50x.html; } if (!-e $request_filename) { rewrite ^(.*)$ /index.php?q=$1 last; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/conf/fastcgi_params; } } ???if (!-e $request_filename) ???????.htaccess??????????????url??????????????????index.php?q=??????????????????????????“nginx wordpress”????????????? ??????nginx.conf????????root????????nginx.conf??????“root   html;“????????????/etc/nginx???html???????/srv/http/nginx??????????????????root /srv/http/nginx/ptblog/;????????????????location??????root????????????????????????????????????????????????root?location????????????root???? nginx.conf????include?????????Ubuntu???????????????site.d??????????server?????????????nginx.conf???????????????????????????????????rc.local?????????????????????????????????????????~/bin?????????????sudo lnmp?????1 2 3 4 #!/bin/bash /etc/rc.d/mysqld start cgi-fcgi -start -connect localhost:9000 /usr/bin/php-cgi /etc/rc.d/nginx start???????????????????????????????????N????????????????????php?????? ?????????????nginx??????????PT?????????????????????nginx???wiki?http://wiki.nginx.org?Configure???????nginx.conf???? tags: mysql, nginx, php, Web, WordPress posted in Unix/Linux by BOYPT Follow comments via the RSS Feed | Leave a comment | Trackback URL6 Comments to "????nginx+fastcgi???WordPress???"isspy wrote:???nginx?????????????apache???????.Link | July 27th, 2009 at 09:42PT wrote:????????????????????……Link | July 29th, 2009 at 18:35lvy wrote:???~Link | September 29th, 2009 at 10:51betaer wrote:??????Link | March 20th, 2010 at 00:31smartwei wrote:“???nginx+fastcgi?????????????????apache+mod_cgi????nginx??????apache?????????“?????nginx???????????????????????????????????apache?????????apache??nginx??Link | September 25th, 2010 at 01:21BOYPT wrote:@smartwei: ????????????????????fastcgi??????????????????????????vps????100M??????nginx+fastcgi????wordpress?????????Link | September 25th, 2010 at 12:42Leave Your Comment Name (required) Mail (will not be published) (required) Website [...]

Avatar

How to build a scalable, caching, resizing image server | Sumit Birla

November 11th, 2011 at 1pm

Avatar

Nginx with PHP (FCGI) – A lightweight web server | Tautvidas Sipavi?ius

January 22nd, 2012 at 6am

[...] apt-get install php5-cgiTo spawn FastCGI processes, we’ll need to use these two scripts (Original author), provided on Nginx wiki:#! /bin/sh ### BEGIN INIT INFO # Provides: php-fastcgi # Required-Start: [...]

Avatar

How to build a scalable, caching, resizing image server

April 28th, 2012 at 11pm

Avatar

Apache Admin Notes: Raw Performance Numbers | Ryan McKern has something to say

August 13th, 2012 at 1pm

[...] I couldn't have started to work out the nginx fastCGI con­fig­u­ra­tion with­out help from this post on redemp­tion in [...]

Avatar

????? Nginx ???? | ??.IT

November 16th, 2012 at 1pm

[...] Nginx, PHP and a PHP FastCGI daemon init script (with init script for PHP FastCGI) [...]

Avatar

SPDY for the TYPO3 Backend: A First Benchmark | global-sites.com

March 1st, 2013 at 12am

[...] or see http://blog.codefront.net/2007/06/11/nginx-php-and-a-php-fastcgi-daemon-init-script/ [...]

Avatar

SPDY für das TYPO3 Backend: Erstes Benchmark | global-sites.com

March 1st, 2013 at 5am

[...] or see http://blog.codefront.net/2007/06/11/nginx-php-and-a-php-fastcgi-daemon-init-script/ [...]