[Resolved] LiteSpeed Path Issue

#1
Having an issue with RVSitebuilder. It appears the script wants to pull from the path which LiteSpeed does not have configured.

[STDERR] PHP Warning: is_file() [<a href='function.is-file'>function.is-file</a>]: open_basedir restriction in effect. File(/usr/local/lsws/lsphp5/lib/php/RVSeagullMod/lib/SGL/FrontController.php) is not within the allowed path(s): (/home/philipss:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/philipss/public_html/new/rvscommonfunc.php on line 50


FrontController.php is located @ /usr/local/lib/php/RVSeagullMod/lib/SGL/FrontController.php

So the question is how do I append to the path to meet the requirements of this or change where the default path is searched?
 
Last edited by a moderator:

NiteWave

Administrator
#2
as the warning message suggested,

FrontController.php is located at /usr/local/lsws/lsphp5/lib/php/RVSeagullMod/lib/SGL/

so you need add
/usr/local/lsws/lsphp5/lib/php/RVSeagullMod/lib/SGL/
or (should be better)
/usr/local/lsws/lsphp5/lib/php/
to your open_basedir (search php.ini)
 
#3
That is not the proper path though as explained clearly. The proper path is :

/usr/local/lib/php/RVSeagullMod/lib/SGL/FrontController.php
 

NiteWave

Administrator
#6
so I think the issue is almost clear: the order of include paths.

when
PHP:
include "RVSeagullMod/lib/SGL/FrontController.php"
it searches FrontController.php in order of include_path

you wish it get
/usr/local/lib/php/RVSeagullMod/lib/SGL/FrontController.php
instead of
/usr/local/lsws/lsphp5/lib/php/RVSeagullMod/lib/SGL/FrontController.php

then try to change include_path in php.ini to
.:/usr/local/lib/php:/usr/local/lsws/lsphp5/lib/php
etc
 
#7
No Include path is defined @ /usr/local/lsws/lsphp5/lib/php.ini which IS the php.ini file used.

Where else would it be pulling from?

so I think the issue is almost clear: the order of include paths.

when
PHP:
include "RVSeagullMod/lib/SGL/FrontController.php"
it searches FrontController.php in order of include_path

you wish it get
/usr/local/lib/php/RVSeagullMod/lib/SGL/FrontController.php
instead of
/usr/local/lsws/lsphp5/lib/php/RVSeagullMod/lib/SGL/FrontController.php

then try to change include_path in php.ini to
.:/usr/local/lib/php:/usr/local/lsws/lsphp5/lib/php
etc
 

NiteWave

Administrator
#9
made 2 changes, the cPanel plugin RVSitebuilder working now:
1.edit /usr/local/lsws/lsphp5/lib/php.ini
add
include_path = ".:/usr/local/lib/php:/usr/local/lsws/lsphp5/lib/php"
at the end of php.ini
-- because of RVSitebuilder installed under /usr/local/lib/php

2.edit /usr/local/apache/conf/httpd.conf
vhost "example.com" section, replace
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/home/philipss:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
with
<IfModule sapi_apache2.c>
php_admin_value open_basedir none
</IfModule>
then restart lsws
 

ffeingol

Well-Known Member
#10
Not to get too OT here, but if you hand edited the httpd.conf file you are just waiting for a disaster. The next time cPanel rebuilds httpd.conf those chages will get wiped out.
 
#11
Thanks for the advice.

not sure where following section in httpd.conf
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/home/philipss:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
came from, should it be defined in which part of cPanel?

this value is picked by lsws and results in the final phpinfo() page.
 

ffeingol

Well-Known Member
#12
Those come from a template that cPanel uses to built the virtual host. I'd look at the documentation on virtualhost includes (http://docs.cpanel.net/twiki/bin/view/EasyApache3/InsideVHost#Using_Include_Files) You can create a configuration file that will only be picked up by that one domain. It adds the include at the very bottom of the virtualhost container. If I understand LSWS correct it will pick up the last version of the directive (i.e. if there are multiple open_basedir) so the includes 'should' work perfect with LSWS.
 
#13
yes, /userdata/ is for specific vhost. I saw the directive(php_admin_value ) exist s in every vhost definition. and yes, this is the last version of php_admin_value definition within the vhost.
 
#15
I think "/usr/lib/php:/usr/local/lib/php" is for php5, and "/usr/php4/lib/php:/usr/local/php4/lib/php" for php4. so it includes both php4 and php5.
 
#17
php_admin_value open_basedir "/home/philipss:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
is not set by litespeed. it's set by user or app like RVSitebuilder. lsws just inherit user's setting. the user may set "/usr/php3/lib" at his will, lsws can't guess its php3 and don't inherit it.
 
#18
There is a PHP4 and a PHP5 section set by cPanel for Apache. LiteSpeed should be picking up the PHP5 section.

is not set by litespeed. it's set by user or app like RVSitebuilder. lsws just inherit user's setting. the user may set "/usr/php3/lib" at his will, lsws can't guess its php3 and don't inherit it.
 
Top