Nginx configuration file:
server { listen 80; root /var/www/html; server_name localhost; charset utf-8; index index.html index.htm index.php; location ~ .*. (PHP|PHP5)?${ fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename $document _root$fastcgi_script_name; include fastcgi.conf; }}
The parameters of the $document _root are defined by the root/var/www/html line.
View Log found error: mysql_connect ()
Call to undefined function mysql_connect () in/var/www/html/test.php on line 2 "while reading response headers from Upstrea M
May be due to a lack of php-mysql plug-ins, you can install Yum, and then restart the PHP-FPM service
Test whether Nginx and PHP are connected successfully:
Vim test.php<?php phpinfo ();?>
Test whether PHP and MySQL are connected successfully:
Vim testdb.php<?php $link =mysql_connect (' 127.0.0.1 ', ' root ', ' 123456 '); if (! $link) echo "fail"; else echo "Success"; ?>
Nginx Configuration PHP environment, and test whether PHP can connect MySQL