what is the best way to modify open_basedir restriction to allow authorized items

durangod

Well-Known Member
May 12, 2012
516
47
78
cPanel Access Level
Website Owner
On of the addons for my whmcs is giving a warning about open_basedir and the file is not in the proper path.

The file for the addon is in public_html/whmcs/modules/addons/filename.php
I am calling it from public_html
and i am also calling it from public_html/whmcs/filename.php


Do i have to turn off open_basedir or can i adjust it via htaccess ? Or can you point me to some docs on the subject thanks.

here is the warning:

Warning: is_file(): open_basedir restriction in effect. File(/home/xxxxxx/public_html/whmcs/modules/addons/index.php/index.php.php) is not within the allowed path(s): (/home/xxxxxxx:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/xxxxxxx/public_html/whmcs/admin/configaddonmods.php on line 0
- - - Updated - - -

interesting, i did not know open_basedir was a requirement for WHMCS... well how about that.

- - - Updated - - -

I found the docs, :) im ok now..
 
Last edited:

SS-Maddy

Well-Known Member
Mar 28, 2009
130
18
68
cPanel Access Level
Root Administrator
Hello

Disabling open_basedir restriction through .htaccess is not possible. open_basedir can only be set by inside the php.ini or httpd.conf. You may need to change the httpd directive or change the php handler to SuPHP from DSO to disable it.
 

server9host

Well-Known Member
Sep 18, 2013
160
0
16
India
cPanel Access Level
Root Administrator
Hello,

Also you can you create custom php.ini to enable "open_basedir" for particular user and disable on server using suPHP. You just need to create custom php.ini in you user home directory and put below code in .htaccess file :

Code:
suPHP_ConfigPath /home/username/public_html/
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello :)

I am happy to see you were able to address the issue. Thank you for updating us with the outcome in your original post.