Reprint: http://www.cnblogs.com/zzyyxxjc/p/4361282.html
After the php5.3 version, php-fpm.conf in the Listen default configuration is 127.0.0.1:9000, will not generate php-fpm.sock, so if you need Nginx configuration has links tmp/ Php-fpm.sock, you need to configure the address of the listen to be consistent with the Nginx configuration file, and ensure that the path already exists, so that when you start the./PHP-FPM, the Php-fpm.sock is automatically generated on the corresponding path, for example:
Let php-fpm use UNIX sockets
By default, port 9000 is listening . In addition, you can make php-fpm use UNIX sockets, which avoids the overhead of TCP. To do this, open the /etc/php-fpm.d/www.conf ...
Vi/etc/php-fpm.d/www.conf
... The following changes are followed:
[...]; Listen = 127.0.0.1:9000listen =/var/run/php-fpm/php5-fpm.sock[...]
Then reload PHP-FPM:
Systemctl Restart Php-fpm.service
Next through your nginx configuration and all the virtual hosts and reroute Fastcgi_pass 127.0.0.1:9000; to Fastcgi_pass unix:/tmp/php5-fpm.sock;, like this:
Vi/etc/nginx/conf.d/default.conf
[...] Location ~. php$ { root /usr/share/nginx/html; Try_files $uri =404; Fastcgi_pass Unix:/var/run/php-fpm/php5-fpm.sock; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include fastcgi_params; } [...]
Finally reload Nginx:
Systemctl Restart Nginx.service
Once this is configured, a Php5-fpm.sock file is automatically generated in the/var/run/php-fpm/directory, and then everything is OK.
The reason why Php-fpm.sock was not found when configuring Nginx and php-fpm to connect with sock sockets