Very simple to set up Nginx, PHP5 and MySQL on Ubuntu. Hats off to the Ubuntu guys for making it so simple.
- sudo apt-get install nginx
- sudo apt-get install php5-cgi (you might need to also need to install php5)
Test that nginx works by opening your browser and going to http://localhost/
Edit /etc/nginx/sites-available/default
Search for the bits that say “# pass the PHP scripts to FastCGI server….” uncomment those configuration bits.
Create index.php in /usr/share/nginx/www/
In it, put:
<?php phpinfo();
In a web browser go to http://localhost/index.php It should give you a “bad gateway error”. This is because php fastCGI isn’t running. Go back to your terminal and type “php5-cgi -b 127.0.0.1:9000 &” This should start php fastCGI in the background. Now visit http://localhost/index.php again and you should see the php info screen.


