Control Web Panel

WebPanel => PHP Selector => Topic started by: hanliong on October 24, 2021, 08:58:46 AM

Title: Problem when swich from PHP-CGI to PHP-FPM
Post by: hanliong on October 24, 2021, 08:58:46 AM
At first, I just use PHP-CGI with selection: php 7.3, php 7.4, and php 8.0
Then, I want to add PHP-FPM too, because I read PHP-FPM can run faster than PHP-CGI. So I enable PHP-FPM for php 7.4 and php 8.0
I tried to one of my site. I change the PHP version from PHP 7.4 (CGI) to PHP 7.4 (FPM), but when opening my site, it gave error 503: Service Unavailable. At error log, it is written: "AH01079: failed to make connection to backend: httpd-UDS"

I changed back to PHP 7.4 (CGI), but it didnt work. It gave the same error. Changing to PHP 8.0 (CGI) and PHP 8.0 (FPM) also gave the same error.
Then only work selector was using PHP 7.3 (CGI).

I tried to find help at google. and I read many people face the same issue with CWP.

My question, is PHP-FPM conflict with PHP-CGI if both of them have the same version? Because it gave the same error for PHP 7.4 and PHP 8.0 which have CGI and FPM option. But it worked with PHP 7.3 because there is no PHP 7.3 FPM installed.
I have tried to restart apache and php-fpm service. but no luck.

How to fix it?
Title: Re: Problem when swich from PHP-CGI to PHP-FPM
Post by: studio4host on October 25, 2021, 07:53:31 AM
with CWPpro you can have all PHP selector and PHP selector fpm's in use at the same time.
fpm can be set per domain using web server domain conf in admin, note that php-fpmXX needs to be started for it to work.

It's also recommended to use monit in cwp admin to handle php-fpm services and keep them alive.
Title: Re: Problem when swich from PHP-CGI to PHP-FPM
Post by: hanliong on October 26, 2021, 01:36:02 AM
I have done all. I ensure the FPM service was started as well as using monit to monitor it. And at monit it said OK, there is no problem.
But when accessing the website, it gave erro 503: Service Unavailable. At error log, it is written: "AH01079: failed to make connection to backend: httpd-UDS".
I find at google there are many people face the same issue with CWPPro, and there is no exact solution for that.
Title: Re: Problem when swich from PHP-CGI to PHP-FPM
Post by: studio4host on October 26, 2021, 07:56:54 PM
there is a solution for everything you just need to check this with someone having experiences like sysadmin or cwp support.
Title: Re: Problem when swich from PHP-CGI to PHP-FPM
Post by: compacmedia on October 27, 2021, 12:12:01 AM
After the last update, I also rebuilt Control Web Panel Settings and Setup default Web Servers, after which a domain that had this problem worked again.
Title: Re: Problem when swich from PHP-CGI to PHP-FPM
Post by: hanliong on October 27, 2021, 02:13:16 AM
After the last update, I also rebuilt Control Web Panel Settings and Setup default Web Servers, after which a domain that had this problem worked again.
What do you mean by rebuilding CWP Setting?
"Setup default Web Servers", do you mean running to rebuild apache only or apache + nginx?

Thanks.