Comments on Installing Nginx With PHP5 And MySQL Support On Debian Lenny
Installing Nginx With PHP5 And MySQL Support On Debian Lenny Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a Debian Lenny server with PHP5 support (through FastCGI) and MySQL support.
8 Comment(s)
Comments
I know this is old, but man, why do people keep insisting on installing spawn-fcgi from lighty? The whole idea here is to use nginx, and now we're cribbing from lighty. Worse yet, it's totally unnecessary!
php -b 127.0.0.1:9000 will do the SAME thing as spawn-fcgi, without having to install two webservers. Want that to happen automatically? try an init script:
"We've installed lighttpd because we need just one program that comes with the package..."
you should have known you'd gone wrong right about here (:
hi.
i use command: aptitude install phpmyadmin or apt-get install phpmyadmin to install phpmyadmin,but i failed.why?can u install it yourself to see if u are successful??
expecting ur reply
#spawn-fcgi setup
cd /usr/local/bin
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.2.tar.gz
tar zxvf spawn-fcgi-1.6.2.tar.gz
cd spawn-fcgi-1.6.2
./configure
make
make install
which spawn-fcgi#returned: /usr/local/bin/spawn-fcgi
which php-cgi#returned: /usr/bin/php-cgi
#for help run for spawning
/usr/local/bin/spawn-fcgi --help
#SPAWN it:
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid
#add it to the start up
vi /etc/rc.local#add the following line to the end of file
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid
Hi,
Why do you use 5 worker processes? It is recommended to use one worker per CPU Core, and I do not believe that you have a 5 Core CPU.
I use your nginx for lenny and it's work!
I used many config from several website but it's can't work. I very headache.
I bookmarked this page. Woo Hoooo
Thanks you,
thaicla
Quoting nginx official website : http://wiki.nginx.org/Pitfalls :
"The solution is to set cgi.fix_pathinfo=0 in the php.ini file"
Side note : Adding cgi.fix_pathinfo=1 has no effects since it is the php default setting:
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting ; this to 1 will cause PHP CGI to fix it's paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
A note on spawn-fcgi. I used that tutorial on an ubuntu 10.04 system. I noticed that when i runned,
ab -c100 -n2000 http://example.com:80/info.php
with the configuration above, spawn-fcgi stopped working, before the test ended, spawn-fcgi crushed. When i opened the same url on my browser i saw "Bad Gateway" (or something like that
don't remember exaclty) nginx error. The conclution i made was that somehow it crushed. I tried that many times and i had the same error. The same command with apache on the same server (i had apache runnung on 81 port) had no problem at all.
The same when i used apache as a reverse proxy, still no problems. But i didn't want apache, so i tried to find something else, and i found this: https://www.howtoforge.com/installing-php-5.3-nginx-and-php-fpm-on-ubuntu-debian and i tried it, no problems at all.
Then i saw the comment here with the php -b 127.0.0.1:9000 followed the link provided http://wiki.nginx.org/PHPFcgiExample#Spawning_a_FastCGI_Process and tried the Unix Socket trick, worked x2-x4 faster than any other configuration. So i really reccomend that configuration to anyone want's to use nginx.
This is not working. After making exactly what you've written here, php ends not working at all.