Apologies in advance if my terminology is not on par.
So I've just setup my work dev machine successfully on Fedora Workstation with Nginx and multiple PHP versions (using Remi Collet's Software Collection). I have PHP-5.6.30 listening on Port 9056 and PHP-7.0.19 listening on Port 9070. This works perfectly.
This morning I decided to try running both PHP instances using FPM Sockets, which initially worked until I restarted the PHP-FPM service (this resulted in a 502 Bad gateway in the browser, and (13) Permission Denied error in the nginx error.log).
So using PHP5.6 as an example ... when I first started the php56-php-fpm
service which generated /opt/remi/php56/root/var/run/php-fpm/www.sock
, I changed the generated www.sock
file's user and group to nginx:nginx
. After restarting php56-php-fpm
I learned that www.sock
was being reset to root:root
. Now granted I won't be restarting FPM constantly, but there must be a way to set some defaults on the .sock
file?? My fpm conf files looks like this:
- /opt/remi/php56/root/etc/php-fpm.d/www.conf: https://pastebin.com/EasyHyEs
- /etc/opt/remi/php70/php-fpm.d/www.conf: https://pastebin.com/dhT8AEJK
- /etc/nginx/nginx.conf: https://pastebin.com/tMuAFnGM
- /etc/nginx/conf.d/default.conf: https://pastebin.com/UjkrcaYw
I realise that this sounds like a pain to get working correctly, considering that I am just doing this for local development, and that I did have this all working correctly using ports 9056 & 9070. But I've read that there are some speed benefits using sockets versus TCP, and anything that would speed up my local dev environment is worth making the effort for.
So my questions:
- What in my config is incorrect that is causing www.sock to be reset to
root:root
after restarting the respective FPM service? - Is it really worth moving away from ports in favour of sockets?
- [slightly off-topic]: using Remi Collet's software collection, I see that the 2 PHP packages install to different locations:
/opt/remi/php56
and/etc/opt/remi/php70
... for the purpose of consistency, should I consider moving either one of these into a more common location?
Thank you