Note: The author's system environment is ubuntu17.04,16.04 can also be fully installed in the other version of the tutorial installation may be some download software version differences.
Installing Nginx
First install Nginx: sudo apt-get insatll nginx
Start Nginx: sudo service nginx start
Open your browser input localhost, display the following instructions to install the success
Install PHP
Next we install PHP (the installation version of PHP in the system above ubuntu16.04 is 7.0)
Install command: sudo apt-get install php7.0-fpm
Then modify the Nginx configuration file so that it can parse PHP, open the Nginx configuration file
Command: sudo vim/etc/nginx/sites-available/default
Modify the text 41 behavior
Modify rows 56 through 63 to:
After the modification is complete, reload the configuration file.
Command: sudo service nginx reload
Next we modify the PHP configuration file.
Command: sudo vim/etc/php/7.0/fpm/pool.d/www.conf
Add 37 lines of content to the text corresponding position
After the modification is complete, we start the next php7.0-fpm.
Command:sudo service php7.0-fpm start
Create the info.php in the/var/www directory (this command is omitted).
The info.php code is as follows:
The following information appears in the browser input localhost/info.php to indicate that the configuration was successful. Nginx can successfully parse the PHP.
Install MySQL
commands for installing MySQL: sudo apt-get install mysql-server mysql-client
Next, install the MySQL extension of PHP, search for the next MySQL extension installation package first.
command : Apt-cache search Php7.0-mysql
Expansion Pack There's only one, so we'll install Php7.0-mysql.
command : sudo apt-get install php7.0-mysql
reboot under PHP-FPM after installation is complete
Command:sudo service php5-fpm restart
I inserted a piece of data in the database ahead of time (if there is an unauthorized connection to the database, look at my previous blog: http://www.cnblogs.com/koocookie/p/7245197.html)
We continue to create a mysql.php content under/var/www as follows:
Opening the browser appears if the message appears, the entire LNMP environment is built successfully.
Summary: Download Nginx,php7.0-fpm,mysql,php7.0-mysql separately. Modify the corresponding Nginx and PHP configuration files. The configuration process encountered problems do not tense, carefully follow the tutorial walk can build success.
ubuntu17.04 under Installation Lnmp