NginX, PHP, FastCGI
I added PHP to bbox512 nginx .
1. Preparation
For Debian/Ubuntu it needed FastCGI:
# apt-get install libfcgi0
2. RTFM
- Init-script for php-cgi in external FASTCGI Mode
- Nginx, PHP and a PHP FastCGI daemon init script
- bye Redskin, zdravstvujte Redstar
3. Installation
# cd /etc/default/ # wget -O php-fastcgi http://zhware.net/files/nginx/php-fastcgi.txt # cd /etc/init.d/ # wget -O php-fastcgi http://zhware.net/files/nginx/php-fastcgi.rc.txt # chmod 755 php-fastcgi # cd /opt/nginx/conf/sites/ # wget -O static.conf http://zhware.net/files/nginx/sites/static.conf.txt # /etc/init.d/php-fastcgi start # kill -HUP `cat /opt/nginx/logs/nginx.pid`
In fact it’s just starting FastCGI PHP instances and making small changes to the sites/static.conf to process files with .php extension:
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /opt/nginx/html$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; }