Home>Article>Backend Development> nginx cannot parse php files

nginx cannot parse php files

angryTom
angryTom Original
2019-10-17 13:52:25 4830browse

nginx cannot parse php files

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:

nginx cannot parse php files

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!

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