Install php 5.6 on yum on centos7
<code>vim /etc/php-fpm.d/www.conf </code>
Modification
<code>;listen = 127.0.0.1:9000 listen=/dev/shm/php-fcgi.sock</code>
Create php-fcgi.sock
file
<code>touch listen=/dev/shm/php-fcgi.sock chmod 777 /dev/shm/php-fcgi.sock</code>
Restart php-fpm
<code>systemctl restart php-fpm</code>
But /dev/shm/php-fcgi.sock
is still an ordinary file, not a socket file. Check the log and there is no error. How to solve it?
Install php 5.6 on yum on centos7
<code>vim /etc/php-fpm.d/www.conf </code>
Modification
<code>;listen = 127.0.0.1:9000 listen=/dev/shm/php-fcgi.sock</code>
Create php-fcgi.sock
file
<code>touch listen=/dev/shm/php-fcgi.sock chmod 777 /dev/shm/php-fcgi.sock</code>
Restart php-fpm
<code>systemctl restart php-fpm</code>
But /dev/shm/php-fcgi.sock
is still an ordinary file, not a socket file. Check the log and there is no error. How to solve it?
Delete ordinary files. When running in Unix Socket mode, sock files are created by php-fpm
Isn’t it written in the configuration file? php-fpm will generate this socket file by itself and be referenced by the master process
<code>; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all IPv4 addresses on a ; specific port; ; '[::]:port' - to listen on a TCP socket to all addresses ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. </code>
I feel like the configuration is written wrong.
php-fpm.conf
<code>listen = /dev/shm/php-fcgi.sock listen.owner = www listen.group = www listen.mode = 0660</code>
nginx.conf
<code>fastcgi_pass unix:/dev/shm/php-fcgi.sock;</code>