nginx cannot parse php under centos system

王林
Release: 2020-03-20 15:21:51
Original
2295 people have browsed it

nginx cannot parse php under centos system

Problem:

An error is reported when parsing PHP through Nginx, prompting File Not Found.

Solution:

View the error log:

[root@LNMP ~]# tail /usr/local/nginx/logs/error.log
Copy after login

nginx cannot parse php under centos system

(Recommended tutorial: centos usage tutorial)

The solution is as follows:

In the Nginx configuration file Find the place where the calling script file is defined

nginx cannot parse php under centos system

and change the code:

fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
Copy after login

to:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Copy after login

nginx cannot parse php under centos system

Finally restart Nginx.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of nginx cannot parse php under centos system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template