• notice
  • Congratulations on the launch of the Sought Tech site

Centos8 nginx plus php7.4 does not listen to port 9000 and reports error 500 solution

Today, lnmp was built on centos8: the ring of nginx+php7.4+mysql8 was installed under centos8, and after the results were all set up, it was found that the access error was 500. Then I checked and found that it did not listen to port 9000, because it defaulted to the unix file mode, so there was the following centos8 nginx plus php7.4 did not listen to port 9000 and reported an error 500 solution.

1605159736.jpg

The first step is to check whether port 9000 is listening:


netstat -ant | grep 9000 _

If not found and your php-fpm service has been started, then your php-fpm is not using network mode;


Of course, you can also directly check the connection method of the listen configuration in /etc/php-fpm.d/www.conf


vim /etc/php-fpm.d/www.conf _ _ _ _ _ _ _ _ _ _ _

If it is: listen = /run/php-fpm/www.sock, it means Unix sock connection


If it is: listen = 127.0.0.1:9000, it means the network mode

According to the settings here, modify the response at the place where nginx calls the PHP proxy.


listen = /run/php-fpm/www.sock corresponds to fastcgi_pass unix:/run/php-fpm/www.sock;

listen = 127.0.0.1:9000 corresponds to fastcgi_pass 127.0.0.1:9000;

After the setting is complete, restart the nginx service and it will be OK


systemctl restart nginx.service


OK tutorial is here, continue to move bricks~~~


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+