PHP-FPM with LiteSpeed under cPanel

#1
Hello,

Logged as root in cPanel, and on a page "Set PHP Version per Domain" I've set PHP Version to ea-php56 and PHP-FPM is ON for a specific domain. And still phpinfo() under the domain shows: Server API LiteSpeed V6.10.

I see a FPM pool is created, the config files exists in /opt/cpanel/ea-php56/root/etc/php-fpm.d/ and socket is ready /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/94d49cf160dc86bb345671f4a1c956d336aad50f.sock, but still LiteSpeed ignores chosen PHP-mode and still handles all the requests via lsphp.

Is it an issue of cPanel or LiteSpeed? And how can I set LiteSpeed to use PHP-FPM for my domain?
 

Pong

Administrator
Staff member
#2
It is expected by design. LiteSpeed should use lsphp while apache may use fastcgi/suphp/php-fpm. LSPHP has better performance than other handlers, which is one of the reason to make LiteSpeed faster.
 

Crazy Serb

Well-Known Member
#6
It is expected by design. LiteSpeed should use lsphp while apache may use fastcgi/suphp/php-fpm. LSPHP has better performance than other handlers, which is one of the reason to make LiteSpeed faster.
Funny, because I find that the minute I turn on the PHP suEXEC option in Litespeed over any other handler/option, the CPU usage at least doubles and all the sites start loading much, much slower. As in, a big site that usually loads in 2 seconds takes anywhere from 12-20 seconds to load with PHP suEXEC turned on.

So much for better performance...

And if Litespeed is on, but PHP suEXEC option is turned off, what does PHP use as a handler then? Whatever we set in WHM -> MultiPHP Manager section where it gives us the option of handlers (cgi, none, suphp) or PHP-FPM?!
 

Pong

Administrator
Staff member
#7
First, let's clarify about PHP SuEXEC:
PHP suEXEC is not PHP handler. For Apache, If you run shared hosting server, you will have to run PHP SuEXEC mode for apache, otherwise one user may be able to access other users's files. PHP SuEXEC is generally slower than non-PHP SuEXEC mode. It is normally set when you cpanel first installed with your apache and generally you can't change the mode after to avoid permission problem.
Once your apache set to PHP SuEXEC(yes or no), LSWS will pick up the setting during the LSWS installation. You can NOT switch between Non-SuEXEC and PHP SuEXEC.

Second, once the PHP SuEXEC is set for both Apache and LSWS, in terms of the PHP handler, LSPHP is better than Apache php-fpm, cgi, SuPHP(no matter PHP SuEXEC is on, or Off)

Third, but the most important, you should enable cache avoid PHP processes, which is the most important mothod to make your site fly, PHP handler doesn't help much because Cache is 1000x time faster,
 
Last edited:
Top