MultiPHP INI Editor is not working with mod_lsapi

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
128
29
78
Brazil
cPanel Access Level
Root Administrator
Hello,

I migrated to CloudLinux recently and started to use mod_isapi.

And I noticed that the MultiPHP INI Editor does not work with this module because the Editor adds a line that checks by php7_module.

Example:
Code:
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_flag display_errors Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
if I remove <IfModule php7_module>, then everything works normally.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Hello,

Could you verify which version of PHP is enabled for the account in "cPanel >> MultiPHP Manager"?

Thank you.
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
466
113
UK
cPanel Access Level
Root Administrator
Since the all too brief love affair between cPanel and Cloudlinux seems to have degenerated into an unhappy marriage, and Cloudlinux have repeatedly stated that they will drop their implementation of PHP Selector as soon as the MultiPHPManager reaches feature parity, I don't hold out much hope of anything much being done to further develop the inter-compatibility between these two solutions.

Personally, my customers all prefer the Cloudlinux implementation using PHP Selector |extension manager | options over the cPanel MultiPHPManager and their MultiPHP INI Editor, even though the latter potentially allows better and more flexible control over the PHP environment.

I run mod_lsapi with lsapi set as the handler, and use alt-php and PHP Selector for all my clients, and my clients and I are delighted with the results.
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
128
29
78
Brazil
cPanel Access Level
Root Administrator
I don't hold out much hope of anything much being done to further develop the inter-compatibility between these two solutions.
I agree.

Personally, my customers all prefer the Cloudlinux implementation using PHP Selector |extension manager | options over the cPanel MultiPHPManager and their MultiPHP INI Editor, even though the latter potentially allows better and more flexible control over the PHP environment.

I run mod_lsapi with lsapi set as the handler, and use alt-php and PHP Selector for all my clients, and my clients and I are delighted with the results.
This depends on the type of client, on my server I like to facilitate for clients, and MultiPHP has an easier interface.

We like the principle: less is more.
 
  • Like
Reactions: cPAusaf

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Hello,

Could you open a support ticket using the link in my signature so we can test this further to determine if the behavior is a bug?

Thank you.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Hello,

As I understand, this would be a bug with LSAPI as opposed to cPanel. Could you report this to the CloudLinux support team and let us know the ticket number?

CloudLinux - Submit A Support Request

Thank you.
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
128
29
78
Brazil
cPanel Access Level
Root Administrator
Hello Michael,

I opened a support ticket in cPanel and was informed of the following:
Development teams have sent an updated reply. It seems that the MultiPHP INI Editor is not integrated with mod_lsapi. This is precisely why you may be experiencing this issue.

Currently the .htaccess settings which are adjusted for PHP only apply when the PHP handler is set DSO. So if you notice these options in the .htaccess file it is to accommodate the handler being DSO. If you would like to see lsapi integrated into MultiPHP INI Editor, it was recommended that you open a new feature request.
Then I opened a feature request:
Make MultiPHP INI Editor work with mod_lsapi
 
  • Like
Reactions: cPanelMichael

Trane Francks

Well-Known Member
Jun 19, 2012
106
19
68
Machida, Tokyo, Japan
cPanel Access Level
Root Administrator
Was this issue ever resolved?

I am currently experiencing a situation where we are using CLOUDLINUX 7.4 with EA4 & mod_lsapi and MultiPHP Selector / MultiPHP INI Editor and .user.ini changes are NOT being indicated with phpinfo().

I took one look at alt_php/PHP Selector and immediately felt that the vast majority of users would be much better served by ea-php*/MultiPHP due to the easy way of understanding/editing PHP settings in the MultiPHP INI Editor. Changes in WHM 68.0.33 do not appear to be picked up. mod_lsapi is globally enabled for all PHP versions installed (5.6.x+).

I like the small memory footprint and performance of mod_lsapi. I added the following to Apache's pre-virtualhost configuration:

<IfModule lsapi_module>
AddType application/x-httpd-lsphp .php
lsapi_user_ini_homedir On
lsapi_process_phpini On
lsapi_debug Off
</IfModule>

Apparently, mod_lsapi and MultiPHP just don't jibe. Either that or I'm missing something.

Please advise.

trane
 

Trane Francks

Well-Known Member
Jun 19, 2012
106
19
68
Machida, Tokyo, Japan
cPanel Access Level
Root Administrator
SOLVED:

I added this to my global Pre VirtualHost Include:

<IfModule lsapi_module>
AddType application/x-httpd-lsphp .php
lsapi_enable_user_ini On
lsapi_user_ini_homedir On
lsapi_process_phpini On
lsapi_mod_php_behaviour Off
lsapi_debug Off
</IfModule>

And then added this to the user .htaccess immediately above the cPanel-generated php ini directives:

lsapi_phpini /home/USER/public_html/php.ini

Where USER is changed to the actual name of the user account. As long as the user is informed to add the lsapi_phpini directive to .htaccess, all should work as hoped/expected.
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
128
29
78
Brazil
cPanel Access Level
Root Administrator
FINAL CLARIFICATION:

The only entry that seems necessary in Pre VirtualHost Include to make .user.ini files read by mod_lsapi is below (no .htaccess directives required):

<IfModule lsapi_module>
lsapi_enable_user_ini On
</IfModule>
For security reasons, I do not recommend that you use this.
The user can override settings in php.ini that shouldn't.
 

Trane Francks

Well-Known Member
Jun 19, 2012
106
19
68
Machida, Tokyo, Japan
cPanel Access Level
Root Administrator
For security reasons, I do not recommend that you use this.
The user can override settings in php.ini that shouldn't.
MultiPHP INI Editor creates the .user.ini file and is the mechanism by which PHP-FPM is supported. If you change any PHP settings with that editor, it creates BOTH a local php.ini AND the .user.ini. By adding the lsapi_enable_user_ini pre virtualhost include directive, your INI file is read.

In other words, MultiPHP INI Editor and mod_lsapi already work together.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463

Trane Francks

Well-Known Member
Jun 19, 2012
106
19
68
Machida, Tokyo, Japan
cPanel Access Level
Root Administrator
Hello, the link is broken. I have the topic problem.

Thanks
Cristian
Add the following to your Pre VirtualHost Include apache configuration and everything just works:

<IfModule lsapi_module>
lsapi_enable_user_ini On
</IfModule>


cPanelMichael said:
Do you mind reopening this feature request?
I'm confused. mod_lsapi works just fine with MultiPHP INI Editor with existing mechanisms. What feature is actually missing?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
I'm confused. mod_lsapi works just fine with MultiPHP INI Editor with existing mechanisms. What feature is actually missing?
Hello @Trane Francks,

It doesn't work out of the box unless a manual workaround is implemented. The idea behind the feature request would be for the MultiPHP INI Editor to automatically detect that LiteSpeed is enabled and to make the appropriate changes.

Thank you.