What is the easiest way to enable PHP on nginx on Ubuntu 12.04?
Best solution is the one that request minimal work, ideally just a package installation :)
|
|
|
The following method will get you started fast on Ubuntu 12.04;
Test that it's working (should see "Welcome to nginx!")
In your nginx site configuration (/etc/nginx/sites-available/default), uncomment the lines in the server {} section starting with
scroll down to where it says "location ~ .php {" and uncomment lines so it looks like this:
Your default web root is located at /usr/share/nginx/www (per the config file). (See (Note: For Ubuntu 12.10 or newer, you will need to replace the |
||||
|
|
The answer of @papashou is correct. As I use Ubuntu 12.10, the configuration is a bit different. Here is what I did: Install
Enable PHP Uncomment the following lines in configuration file
Start (or restart)
Test Opening this link Test Create a php file:
Opening |
||||
|
|