Comments on Nginx HTTP Server + PHP5 (With fast-cgi And xcache) On Ubuntu Feisty Fawn

Nginx HTTP Server + PHP5 (With fast-cgi And xcache) On Ubuntu Feisty Fawn This HowTo describes the implementation of Nginx with php5 support (through FastCGI). The fast-cgi process will be initiated via spawn-fcgi. Nginx is a great replacement of Apache with very low memory footprint and contrary to Lighttpd, doesn't suffer from memory leak over time. You can then use all the memory left to unleash the power of mysql for instance by increasing the default query cache.

7 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

Nice writeup guys.

 It would be great if you could add how to add eAccelorator to this setup.  That or create a new article and mash it up with the previous one:

https://www.howtoforge.com/eaccelerator_php5_debian_etch

Keep up the great work. 

By:

it's my first howto. wrote it because i couldn't find any real and simple solution for having nginx + fcgi running automatically at startup. eaccelerator runs the same way on ubuntu than on etch.  i'm curious to compare the benchmarks between xcache and eaccelerator for nginx. 

By:

Great Thanks!!!!!

By:

Many thanks for this great article. I've found it very helpful.

I've installed nginx + FastCGI + PHP in Debian Etch. My PHP application is WordPress. Just in case someone needs it,  a rewrite rule is necessary in nginx.conf if we want WordPress to work properly:

 

        location / {
            root   /var/www/blog.mydomain.com;
            index  index.php;
            if (-e $request_filename) {
              break;
            }
            rewrite ^/(.+)$ /index.php?q=$1 last;
        }


 
More information:

By: Denis

spawn-fcgi is definitely a bad choice for running php as fastcgi, look at the php-fpm instead.

By: Kuba

Hi,

in newest Ubuntu versions you can install spawn-fcgi package without need of downloading lighttpd.

 

By: Initcron

I have automated nginx + php5 + php5-fpm setup on ubuntu 10.4 lucid with my scripted install. It is available freely under GNU GPL 3.0 at http://www.initcron.org/how-tos/autoinstall-nginx-web-server-with-php-on-ubuntu-10-4-lucid This takes care of most of the steps above.