Home >Backend Development >PHP Tutorial >The easiest way to build Nginx and PHP environments in Ubuntu_PHP Tutorial
This article mainly introduces the simplest method to build Nginx and PHP environments in Ubuntu. This article explains the use of apt -The get tool installs Nginx and PHP environments, and explains the basic configuration. Friends in need can refer to it
Foreword: The results from Baidu are very misleading, and some articles say that others are cheating, but he himself is also cheating. Please be kind to the industry. Google is still reliable.
System environment: Both Ubuntu 13 and Linux Mint 15 passed.
The default installation is nginx 1.2.5, php5.4.9
Install first:
The code is as follows:
Then edit the configuration file.
The code is as follows:
Find the location ~ .php$, uncomment the 5th line, it will become like this:
The code is as follows:
That’s it!
Start nginx:
The code is as follows:
1. In the default file, find
The code is as follows:
The code is as follows:
2.default file, add
in the location / {} directive of the server{} directiveThe code is as follows:
3. The root line of the server{} indicator is the root directory of the file. If you modify it yourself, you can use that folder as the root directory of the website