1 (edited by khav 2015-01-15 13:03:38)

Topic: Unable to use PHP-FPM with socket on centos 7

I installed php-fpm using remi repository and i get 502 bad gateway when i tried to access php files

In php-fpm.conf

include=/etc/php-fpm.d/*.conf
pid = /run/php-fpm/php-fpm.pid


In www.conf

listen = /tmp/php5-fpm.sock
user = nginx
group = nginx
;listen.owner = nobody
;listen.group = nobody
listen.mode = 0666

In my nginx conf

fastcgi_pass   unix:/tmp/php5-fpm.sock;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
include        fastcgi_params;


I chown my root directory to nginx:nginx
The php-fpm.pid exists
The php5-fpm.sock is not  created in the tmp folder

Re: Unable to use PHP-FPM with socket on centos 7

Using /tmp is a very bad idea (because of PrivateTmp systemd security feature)

Try with /run/php-fpm/www.sock

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Unable to use PHP-FPM with socket on centos 7

Yes i found it the hard way.... php-fpm sock file couldn't write in /tmp

I wonder what's more to discover with this new OS