Installation:
sudo apt-get install nginx php7.0-fpm mysql-server-5.6 php7.0-mysql
Then change the configuration file, PHP configuration file can not be used, nginx configuration file, PHP CGI is not supported by default, so it has to be changed:
vim/etc/nginx/sites-available/default
Find
#
#location ~ \.php$ {
# Include snippets/fastcgi-php.conf;
# # # with
php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# with PHP5-FPM:
# fastcgi_pass Unix:/var/run/php5-fpm.sock;
#}
changed to
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# with php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# with PHP5-FPM:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
It probably means that all the files that have a positive ending to PHP are passed to PHP7.0-FPM to process, the results sent to Nginx, and then sent to the client by Nginx and
then restarted service:
systemctl restart Nginx
systemctl Restart php7.0-fpm
systemctl restart MySQL
just fine. The default site root is in/var/www/html/( Can through the Nginx configuration file in the root of the line to change the
main problem is to take WordPress and the like, to index.php as the homepage
is the Nginx configuration file in the
index index.html Index.htm index.nginx-debian.html;
Change into index.php