nginx cannot parse php files

angryTom
Release: 2023-02-27 07:26:01
Original
4910 people have browsed it

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;
        }
Copy after login

2. Reload nginx configuration

/usr/local/nginx/nginx -s reload
Copy after login

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!