Home > Article > Backend Development > How to solve Nginx not parsing php
This article mainly shares with you how to solve the problem of Nginx not parsing PHP. I hope it can help everyone.
Solution:
1./etc/php5/cgi/php.ini
/etc/php5/fpm/php.ini
Modify php.ini cgi.fix_pathinfo=1
2 in the file, modify the nginx.conf file
location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:8000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/$fastcgi_script_name; //给出文件的真实路径 include fastcgi_params; }
3, start
spawn- fcgi -a 127.0.0.1 -p 8000 -C 10 -u nobody -f /usr/bin/php-cgi
Comprehensive analysis of how to install yar extension in php7
Analysis of PHP Dependency injection methods
Analysis of PHP dependency injection and control inversion
The above is the detailed content of How to solve Nginx not parsing php. For more information, please follow other related articles on the PHP Chinese website!