What to do if linux nginx does not parse php

藏色散人
Release: 2023-03-17 11:42:01
Original
1421 people have browsed it

linux nginx does not parse php solution: 1. Check whether port 9000 is in listening state; 2. Check the "php-fpm.conf" file; 3. Modify the nginx configuration to "location ~ \. php$ {fastcgi_pass unix:/dev/shm/php-cgi.sock; #127.0.0.1: 9000 fastcgi_index index...".

What to do if linux nginx does not parse php

The operating environment of this tutorial: linux7.3 system, PHP version 8.1, Dell G3 computer.

linux What should I do if nginx does not parse php?

#nginx does not parse php file 502 solution:

The installed nginx listens to port 9000 by default

Query port 9000 Whether it is in the listening state

netstat -antp | grep :9000
Copy after login

After querying, it was found that it was not found. Check the php-fpm.conf file

cat /usr/local/php/etc/php-fpm.conf
Copy after login

Modify nginx configuration

location ~ \.php$ {
    fastcgi_pass   unix:/dev/shm/php-cgi.sock;    #127.0.0.1:9000
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    include        fastcgi_params;
}
Copy after login

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if linux nginx does not parse php. 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