Skip to main content

Service Unavailable error with PHP-FPM

Comments

14 comments

  • cPanelMichael
    Hello, Could you let us know the output from /usr/local/apache/logs/error_log when this happens? Thank you.
    0
  • Nirjonadda
    Hello, Could you let us know the output from /usr/local/apache/logs/error_log when this happens? Thank you.

    /usr/local/apache/logs/error_log
    [Sat Dec 17 01:16:10.153706 2016] [proxy:error] [pid 2991] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed [Sat Dec 17 01:16:10.153798 2016] [proxy_fcgi:error] [pid 2991] [client 14.170.123.28:64107] AH01079: failed to make connection to backend: httpd-UDS [Sat Dec 17 01:16:11.887476 2016] [proxy:error] [pid 2840] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed [Sat Dec 17 01:16:11.887555 2016] [proxy_fcgi:error] [pid 2840] [client 163.172.66.79:21440] AH01079: failed to make connection to backend: httpd-UDS [Sat Dec 17 01:16:12.282225 2016] [proxy:error] [pid 2853] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed [Sat Dec 17 01:16:12.282290 2016] [proxy_fcgi:error] [pid 2853] [client 14.170.123.28:64109] AH01079: failed to make connection to backend: httpd-UDS [Sat Dec 17 01:16:13.394540 2016] [proxy:error] [pid 3158] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed [Sat Dec 17 01:16:13.394626 2016] [proxy_fcgi:error] [pid 3158] [client 14.170.123.28:64111] AH01079: failed to make connection to backend: httpd-UDS [Sat Dec 17 01:16:14.438597 2016] [proxy:error] [pid 3156] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed [Sat Dec 17 01:16:14.438682 2016] [proxy_fcgi:error] [pid 3156] [client 104.206.223.21:42830] AH01079: failed to make connection to backend: httpd-UDS, referer: http://www.nirmoladda.com/
    0
  • cPanelMichael
    Hello @Nirjonadda, Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome. Thank you.
    0
  • dlook
    I'm having the same exact issue, it throws this randomly like 3 out of 4 times... Also the same error_log output. Had to turn the FPM off because site is in production and that is a bad look. Really disappointed in cPanel, since I vouched with my company to move all our stuff on VPS w/cPanel and now we can't fully use it.
    0
  • cPanelMichael
    Hello @dlook, Could you verify how PHP-FPM was initially enabled on this system? For instance, was it manually enabled on cPanel version 58? Or, did you only start using PHP-FPM with the official support offered in cPanel version 60? Thank you.
    0
  • dlook
    We updated from V 54 I think, first to 56 and then it offered to update to 60, after all updates we turned FPM on.
    0
  • cPanelMichael
    Here are some commands that will help with finding accounts with PHP-FPM enabled via the manual steps in cPanel version 58:
    find /etc/apache2/conf.d/userdata/std/2_4/*/* -type f -name fpm.conf find /etc/apache2/conf.d/userdata/ssl/2_4/*/* -type f -name fpm.conf
    Do you notice any results when running these commands? Thank you.
    0
  • Bigwebmaster
    I was having this issue as well, still unsure of the cause or to why its happening, but I was able to fix it by restarting php-fpm: systemctl restart ea-php70-php-fpm.service That would change depending on what version of PHP is being used and causing the issues. As far as to the errors logged and what it is saying: Jan 31 15:46:01 php-fpm: Tue Jan 31 15:46:01 2017 (715): Fatal Error Unable to create lock file: Bad file descriptor (9) Jan 31 15:46:01 systemd: ea-php70-php-fpm.service: main process exited, code=exited, status=254/n/a Jan 31 15:46:01 systemd: Failed to start The PHP FastCGI Process Manager. Jan 31 15:46:01 systemd: Unit ea-php70-php-fpm.service entered failed state. Jan 31 15:46:01 systemd: ea-php70-php-fpm.service failed. This seems to only happen to us after rebooting the server. It also seems like it is common for the network interface to not be ready when Apache and PHP try to startup as we also have to restart Apache due to its failed state and errors:
    Jan 31 15:46:01 restartsrv_httpd: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 173.236.19.54:80 Jan 31 15:46:01 restartsrv_httpd: no listening sockets available, shutting down Jan 31 15:46:01 restartsrv_httpd: AH00015: Unable to open logs

    [Tue Jan 31 15:56:21.474223 2017] [proxy_fcgi:error] [pid 4065:tid 140077204240128] [client 123.123.123.123:53412] AH01079: failed to make connection to backend: httpd-UDS [Tue Jan 31 15:56:22.050771 2017] [proxy:error] [pid 4247:tid 140077204240128] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php70/root/usr/var/run/php-fpm/3ec4d2c6172cba2f558ff7fe63d570c1b88178d4.sock (*) failed
    Seems that the server is booting too fast and the network isn't ready. I haven't tried this yet, but this sounds promising: Apache (httpd) failing to start on boot - CentOS 7
    0
  • cPanelMichael
    Seems that the server is booting too fast and the network isn't ready.

    Hello, You may also find this post helpful: SOLVED - Apache Service won't start Thank you.
    0
  • Bigwebmaster
    Thanks, I had actually figured this out before your post, but that is pretty much exactly what I did to solve the issue with Apache starting before the network was ready. Besides adding network0online.target I had also added ipaliases.service too: Edit /etc/systemd/system/httpd.service Add:
    After=network-online.target ipaliases.service
    At the end of the [Unit] section.
    0
  • vikelidiskostas
    Just a quick and dirty solution for everyone having the problem mentioned in the first message. Visiting the site shows a "Service Unavailable" message. The Apache error log files shows the following two lines:
    [Sat Mar 18 11:57:43.669230 2017] [proxy:error] [pid 3804:tid 140452393080576] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/hashed_domain.sock (*) failed [Sat Mar 18 11:57:43.669380 2017] [proxy_fcgi:error] [pid 3804:tid 140452393080576] [client xxx.xxx.xxx.xxx:41569] AH01079: failed to make connection to backend: httpd-UDS
    the problem was that there was no directory called php-fpm inside:
    /opt/cpanel/ea-php56/root/usr/var/run.
    I manually created the directory and restarted php-fpm service:
    systemctl restart ea-php56-php-fpm.service
    Now everything works fine. cpanel version: WHM 62.0 (build 16) upgraded from a previous version. Can't remember right now which one.
    0
  • cPanelMichael
    cpanel version: WHM 62.0 (build 16) upgraded from a previous version. Can't remember right now which one.

    Hello, You'd still want to refer back to the following post to determine if PHP-FPM was enabled using an unsupported method: Service Unavailable error with PHP-FPM If so, it's important to revert the steps you took to enable it using the unsupported method and enable PHP-FPM via "WHM >> MultiPHP Manager". There's an additional thread on this topic at: Your system contains an old PHP-FPM configuration - cPanel 60 Thank you.
    0
  • 000
    Just a quick and dirty solution for everyone having the problem mentioned in the first message. Visiting the site shows a "Service Unavailable" message. The Apache error log files shows the following two lines:
    [Sat Mar 18 11:57:43.669230 2017] [proxy:error] [pid 3804:tid 140452393080576] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/hashed_domain.sock (*) failed [Sat Mar 18 11:57:43.669380 2017] [proxy_fcgi:error] [pid 3804:tid 140452393080576] [client xxx.xxx.xxx.xxx:41569] AH01079: failed to make connection to backend: httpd-UDS
    the problem was that there was no directory called php-fpm inside:
    /opt/cpanel/ea-php56/root/usr/var/run.
    I manually created the directory and restarted php-fpm service:
    systemctl restart ea-php56-php-fpm.service
    Now everything works fine. cpanel version: WHM 62.0 (build 16) upgraded from a previous version. Can't remember right now which one.

    hello, I get this:
    [root@pepsi ~]# systemctl restart ea-php7-php-fpm.service Failed to restart ea-php7-php-fpm.service: Unit not found. [root@pepsi ~]#
    0
  • cPRex Jurassic Moderator
    @000 - there is a typo in your command as you only have ea-php7 when you need the specific version, such as ea-php73.
    0

Please sign in to leave a comment.