search
HomeBackend DevelopmentPHP ProblemWhat to do if there is no php cgi process

The solution to the problem that the php cgi process does not exist: 1. Open the corresponding configuration file; 2. Keep the listen in php-fpm.conf consistent with the conf listen in nginx.conf or vhost.

What to do if there is no php cgi process

The operating environment of this article: linux5.9.8 system, PHP5.6, Dell G3 computer.

Is there any php cgi process? PHP starts php-fpm successfully, but the php-cgi process cannot be found. 502 getaway?

Generally, after you have just installed the lnmp environment and changed the fastcgi_pass unix:/tmp/php-cgi.sock item in nginx to fastcgi_pass 127.0.0.1:9000, you will get a 502 error when accessing the web page. Page, the php-cgi process cannot be found using netstat -tlunp.

Solution:

1. LNMP uses unix sockets by default, and the fastcgi_pass parameter in the virtual host configuration file is unix:/tmp/php-cgi.sock;

Need to ensure that the settings in /usr/local/php/etc/php-fpm.conf

PHP 5.3 and above are listen = /tmp/php-cgi.sock

At the same time, fastcgi_pass unix:/tmp/php-cgi.sock; in the virtual host configuration below /usr/local/nginx/conf/nginx.conf and /usr/local/nginx/conf/vhost/ is inconsistent. Must be 502.

2. Sometimes 502 may appear in unix socket mode

You can try changing to tcp/ip

PHP 5.3 and above listen = /tmp/ Replace php-cgi.sock with listen = 127.0.0.1:9000, replace fastcgi_pass unix:/tmp/php-cgi.sock; in the nginx configuration file and virtual host configuration file with fastcgi_pass 127.0.0.1:9000; and then try restarting.

Summary:

/usr/local/php/etc/php-fpm.conf listen should be consistent with nginx.conf or conf listen in vhost

To be consistent with nginx configuration

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if there is no php cgi process. 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
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么判断有没有小数点php怎么判断有没有小数点Apr 20, 2022 pm 08:12 PM

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php怎么设置implode没有分隔符php怎么设置implode没有分隔符Apr 18, 2022 pm 05:39 PM

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

PHP和CGI的文件上传和下载技术:如何实现文件管理功能PHP和CGI的文件上传和下载技术:如何实现文件管理功能Jul 21, 2023 am 11:19 AM

PHP和CGI的文件上传和下载技术:如何实现文件管理功能简介:文件上传和下载是现代Web应用程序中常见的功能之一。本文将介绍如何使用PHP和CGI编程语言实现文件上传和下载功能,并展示一些代码示例来演示如何管理上传和下载的文件。以下是我们将要涵盖的内容:文件上传的基本概念PHP实现文件上传CGI实现文件上传文件下载的基本概念PHP实现文件下载CGI实现文件下

如何使用PHP和CGI实现用户注册和登录功能如何使用PHP和CGI实现用户注册和登录功能Jul 21, 2023 pm 02:31 PM

如何使用PHP和CGI实现用户注册和登录功能用户注册和登录是许多网站必备的功能之一。在本文中,我们将介绍如何使用PHP和CGI来实现这两个功能。我们将通过代码示例来演示整个过程。一、用户注册功能的实现用户注册功能允许新用户创建一个账户,并将其信息保存到数据库中。以下是实现用户注册功能的代码示例:创建数据库表首先,我们需要创建一个数据库表,用于存储用户信息。可

php怎么去除首位数字php怎么去除首位数字Apr 20, 2022 pm 03:23 PM

去除方法:1、使用substr_replace()函数将首位数字替换为空字符串即可,语法“substr_replace($num,"",0,1)”;2、用substr截取从第二位数字开始的全部字符即可,语法“substr($num,1)”。

php怎么去掉数组键值php怎么去掉数组键值Apr 20, 2022 pm 05:12 PM

php去掉数组键值的方法:1、使用“array_keys($array)”语句,可去掉全部键值,返回包含全部键名的数组;2、使用“array_splice($array,$start,$length)”语句,可去掉指定位置的一个或多个键值。

php有操作时间的方法吗php有操作时间的方法吗Apr 20, 2022 pm 04:24 PM

php有操作时间的方法。php中提供了丰富的日期时间处理方法:1、date(),格式化本地日期和时间;2、mktime(),返回日期的时间戳;3、idate(),格式化本地时间为整数;4、strtotime(),将时间字符串转为时间戳等等。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool