Comments on Installing Nginx With PHP5 And MySQL Support On Debian Squeeze
Installing Nginx With PHP5 And MySQL Support On Debian Squeeze 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 Squeeze server with PHP5 support (through FastCGI) and MySQL support.
22 Comment(s)
Comments
Why
apt-get install lighttpd
and
update-rc.d -f lighttpd remove
instead of
apt-get install spawn-fcgi
is there any reason?
I think the author make this tutorial suitable to be use in Debian Lenny as well.
Coz during Debian Lenny time, there is no such package "spawn-fcgi".
The standalone "spawn-fcgi" is only added into the repo start from Squeeze
there is another package wich is now a standalone working daemon:
php5-fdm.
So I can skip the lighttpd step :)
Done on raspbian wheezy :)
Very nice howto. Thx a lot!
Instead of restarting nginx I would simply reload it after having changed the config:
/etc/init.d/nginx reload
Looks like some competition who will make more articles for squeeze by CTRL+C , CTRL+V from LENNY tutorials.
just apt-get install spawn-fcgi is all you need for spawn-fcgi , no need to install lighttpd
Thank you so much !!
it worked and am very happy after trying too much tutorials with no way to get this working
Thanks for your useful article.
Just an integration: in location ~ \.php$ stanza, you should add the following directive:
root /var/www;
otherwise, the DOCUMENT_ROOT php variable is set to an obscure /usr/local/nginx/html, perhaps rooted in the source code :-).
It is weird, since such directive it is already declared in the stanza above...
Hey Falko, I have no words to thank you for your tutorial. I was able to get my VPS up and running in less than 1 hour with LNMP thanks your very good and clear explanation. The unique thing I needed to was reboot the container because I had a 503 Bad Gateway, maybe because I forgot to start spawn-fcgi from console. Did it and everything is running like a charm. Thanks again!
Absolutely brilliant!
Thanks for the informative and well-structured tutorial on this setup! You've made my day.
Keep up the good work.
It works like a charm! :)
A absolutely perfect tutorial. Many thank. Special ovation to the "Make sure that there are some spaces between include and fastcgi_params; - in the default file this is written as one word which is a bug." wow !
Great tutorial! Thank you Falko! I would just suggest that you use bigger code areas to eliminate scroll bars. Keep good work!
Help me, followed the tutorial but in the end when i try to open in Firefox got 502 Bad Gateway
hey there. If try i two times now and i don't get it don. the server it self works fine but the php5 not!
You must probably add one line in ~ \.php$ location:
location ~ \.php$ {
root /var/www;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
include fastcgi_params;
}
Thx for your comment. I'm using a different document root than /var/www. Without the try_files it worked according to the howto. However with try_files, I got an 404. After adding the root statement it works again :)
.. miss out removing apache2 completely (if debian 6 comes with it). Your resources WILL be depleted if apache2 is left on server, with nginx.
Hey,
I've used this article to install nginx&php, but then I read another one which points that there's no need to install fast-cgi because php5-cgi processes can be started and run. So you can skip the step with lighttpd in this tutorial... which is a good start, btw.
Read this for further info: http://tomasz.sterna.tv/2009/04/php-fastcgi-with-nginx-on-ubuntu/
This was one of the most extremely helpful tutorials I've seen on nginx for Debian. Now I have PHP and MySQL up and running successfully. Thank you!!!
I read that setting cgi.fix_pathinfo=1 opens your webserver to exploits. According to this blog you should set it to false ie 0:
https://github.com/jyr/MNPP/issues/17
When I run
"update-rc.d -f lighttpd remove" command, I get an error "update-rc.d: using dependency based boot sequencing".
Everything else goes fine. When I am trying to install "apt-get install php-apc" from your Drupal tutorial, I get the port 80 error again.
Any idea why this must be happening?
Found something here: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=17390&p=174866
Cannot understand what it is.