nginx cannot parse php files?
Recommended learning: PHP video tutorial
1. Check whether nginx.conf is configured correctly
Correct format :
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;# $document_root是root指定的路径 include fastcgi_params; }
2. Reload nginx configuration
/usr/local/nginx/nginx -s reload
3. Check whether php-fpm is started ps -aux |grep php
Started:
The above is the detailed content of nginx cannot parse php files. For more information, please follow other related articles on the PHP Chinese website!