[Resolved] LiteSpeed + cPanel + PhpIniDir Problem

Tim

New Member
#1
Hey there.

We switched from Apache+PHPSUEXEC+cPanel configuration to LiteSpeed+cPanel configuration across 7 servers and 2000+ or so cPanel accounts.

Loving it, can't recommend it enough -- minimal issues and have SERIOUSLY sped up all our servers and dropped the load averages - plus never having HTTP timing out, ever!

However there are two issues I need resolved:

A number of users need things such as:

allow_url_fopen = on
allow_url_include = on

This is switched off by default in our global php.ini, but we can turn it on by editing httpd.conf and within a <virtualhost> - within there we add:

PHPIniDir /home/USERNAME/settings/php.ini

Then in there we add allow_url_fopen = on, or whatever directive we want. Obviously this is a security issue to an extent but some people require it and they have to abide by extra T&Cs.

However if we do that it causes 2 issues:

1. When installing SSL certificate via WHM it errors out as it doesn't know about the PhpIniDir directive.

(To get around this I hash out the phpinidir directive in httpd.conf, restart LS, install SSL, unhash the directive - job done, but this is not a solution)

2. As we're editing httpd.conf directly this is commonly rebuilt from scratch so the PhpIniDir directive is frequently lost.

(To get around this I can make an include file for each virtualhost, but again this is not a solution that I want to go with)

So instead I found I could edit the template for virtualhost creation to add PhpIniDir /home/USERNAME/settings/php.ini so this is auto set for every user -- I can do this, not a problem and it would solve problem 2 nicely.

But I am still stuck with problem 1. When installing the SSL via WHM it errors out as it isn't aware of the PhpIniDir directive -- how would I get around this? How would I tell whatever it is that PhpIniDir is a real thing and not an error?

Surely other hosters who have moved from Apache+PHPSUEXEC+cPanel to LiteSpeed have had this issue too? Have I overlooked the obvious? :)

I have asked cPanel on the offchance but they're unwilling to help me with this issue as it's not really related to their product.

Thanks.

Tim
 
Last edited by a moderator:

Tim

New Member
#3
Ahhhh! Thankyou NiteWave :) I knew I was being dumb.

In case anyone else has this issue...

- Login to LSWS Admin
- Configuration > Server External App > lsphp5 > Edit
- Environment - Add: PHPRC=$VH_ROOT/php

It'll then pickup /php/php.ini after the /usr/local/lib/php.ini

No need to add PhpIniDir to Virtualhosts or do any of the other stuff I was incorrectly doing :)

Thanks again - now this is perfect for our setup!
 
Top