In linux (centos7 + nginx + mysql + php5.6), how does one configure php-fpm? After I run ps-ef | grepphp-fpm, it is displayed as shown in. This should be wrong, right? My nginx configuration is as follows. However, an error was reported during the access. 502. Which of the following experts can explain how I can debug it now...
In linux (centos7 + nginx + mysql + php5.6), how does one configure php-fpm?
After I run ps-ef | grep php-fpm, it is displayed as shown in.
This should be wrong, right?
My nginx configuration is as follows.
However, an error is reported during access. 502,
Which of the following experts can explain how to debug and correct the errors.
Reply content:
In linux (centos7 + nginx + mysql + php5.6), how does one configure php-fpm?
After I run ps-ef | grep php-fpm, it is displayed as shown in.
This should be wrong, right?
My nginx configuration is as follows.
However, an error is reported during access. 502,
Which of the following experts can explain how to debug and correct the errors.
I don't know much about it either, but you mentioned that the php-fpm configuration may be wrong. It provides a clue that your configuration file uses the unixsock method to connect to php-fpm, check whether the configuration file of php-fpm is set to listen to unixsock? You can take a look at the php-fpm.conf listen, I usually use listening to tcp port 9000
You need to check the log, In the var/log php-fpm or nginx
The default php-fpm.conf is:
listen = 127.0.0.1:9000
Corresponding:
fastcgi_pass 127.0.0.1:9000;
And now you are
fastcgi_pass unix:/var/run/php5-fpm.sock;
So the php-fpm.conf should correspond:
listen = /var/run/php5-fpm.sock
Also, when there is a problem with the configuration service, you should first check the error message in the log.
Does lz seem to use the laravel framework? You can try to create a PHP file in the public folder to check whether the file can be accessed normally.
Delete the last location to replace sock with 127.0.0.1: 9000. 502 is returned when a cgi call fails to be executed.