PHP-FPM and mixed web apps.

In attempting to satisfy requirements for a NextCloud installation, I found that other sites on the same server failed to load. After some head scratching I found the issue. The following snippet is from the corresponding Nginx conf file recommended in the NextCloud documentation.

upstream php-handler {
    server 127.0.0.1:9000;
    #server unix:/var/run/php/php7.2-fpm.sock;
}

The corresponding changes made in /etc/php/7.3/fpm/pool.d/www.conf, specifying an ip address and port for the php-handler to listen.

;listen = /run/php/php7.3-fpm.sock
listen = 9000

This killed the other sites’ php connection and ended in 502 errors, as their Nginx conf files were expecting an absolute path. Changing the conf file for the NextCloud installation allowed all to coexist.

upstream php-handler {
    # server 127.0.0.1:9000;
    server unix:/var/run/php/php7.3-fpm.sock;
}

And the corrected /etc/php/7.3/fpm/pool.d/www.conf;

listen = /run/php/php7.3-fpm.sock
;listen = 9000

Leave a Reply

Your email address will not be published. Required fields are marked *