In Linux Nginx and PHP we are separate two different programs, unlike in Windows PHP is just a module of Apache only.
So we let them integration can be, the principle is to submit the user's request by Nginx to an nginx, and then he then forwarded to PHP, PHP processing completed he will return the results to nginx ...
First we come to the Nginx conf configuration file directory to edit the nginx.conf file as follows:
Then we remove the # 65 lines to 71 lines and start editing them:
You can modify it as follows:
Location ~ \. php$ { root html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index. php; Fastcgi_param script_filename /usr/local/nginx/html$fastcgi _script_name; include fastcgi_params; }
Here the path is your own Nginx site storage directory, and then we create a PHP file into the HTML inside the test can be found success, as follows:
Here are a few more places to watch:
Here to load the configuration file where show none then the description does not have a configuration file, then we go to the/usr/local/php5/lib directory to see:
Did not find, because PHP configuration file is similar to xxx.ini this format ...
Then we go to the source code directory of PHP to look at, as follows:
He also prepared two for us ...
Development he means the development environment.
Production he refers to the product environment
Then we can just copy a past.
Then restart the next PHP:
Then in the go to refresh the next page:
This completes the Nginx and PHP integration ...
Kill Thunder Dog---the Integration of Nginx and PHP under Linux no:33 Linux