The content of this article is about the problem that nginx cannot parse php scripts. It has certain reference value. Friends in need can refer to it
1. View Is nginx.conf configured correctly?
Correct format:
location ~ .php$ {
root / usr/share/nginx/html; #Can be placed globally
fastcgi_pass 127.0.0.1:9000; #php-fpm default port should not be changed to 80
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
2. Check whether php-fpm is started ps -aux |grep php
Started:
Related recommendations:
Causes and solutions for errors when starting php-fpm under nginx
PHP uses Nginx to implement reverse To agent
The above is the detailed content of nginx cannot parse php script. For more information, please follow other related articles on the PHP Chinese website!