php-fpm doesn't create .sock file

Kezaia picture Kezaia · Feb 12, 2016 · Viewed 22.4k times · Source

I have an AWS server running on Amazon Linux.

I used this guide to install php7 (bottom of the page): https://forums.aws.amazon.com/thread.jspa?messageID=695576

I would like to use nginx instead of Apache, so I've also installed the php70w-fpm and nginx packages. However, when I service start php-fpm, it does not create a php-fpm.sock file anywhere on my server. I have checked in /var/run and have also ran find / -name "*.sock" which only returns /var/run/rpcbind.sock.

Answer

Pathaksa Tongpitak picture Pathaksa Tongpitak · Sep 16, 2019
  1. Make sure you have the following folder and that it's writable. /var/run/php-fpm

  2. then in your www.conf you put: listen = /var/run/php-fpm/php-fpm.sock

  3. then run: sudo service php-fpm restart

  4. then update your nginx.conf: fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  5. and finally restart nginx: sudo service nginx restart