Home >Operation and Maintenance >CentOS >nginx cannot parse php under centos system

nginx cannot parse php under centos system

王林
王林Original
2020-03-20 15:21:512342browse

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

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;

to:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

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!

Statement:
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