Home > Operation and Maintenance > Nginx > How to solve linux nginx not parsing php

How to solve linux nginx not parsing php

WBOY
Release: 2023-05-12 22:19:11
forward
928 people have browsed it

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

nginx does not parse the php file 502 solution:

The installed nginx listens to the 9000 port by default

Query the 9000 port Whether it is in the listening state

netstat -antp | grep :9000
Copy after login

linux nginx不解析php如何解决

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

linux nginx不解析php如何解决

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

What versions of Linux are there?

Linux versions include: Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and other versions. Among them, Deepin is one of the best-developed Linux distributions in China; Ubuntu Kylin is a derivative distribution based on Ubuntu; Manjaro is a Linux distribution based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP and is simple and easy to use; Ubuntu is a desktop application Mainly Linux operating system.

The above is the detailed content of How to solve linux nginx not parsing php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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