Skip to main content

WHMCS - open_basedir restriction in effect

Comments

13 comments

  • Infopro
    This thread may be of some use:
    0
  • dorac
    Thanks for fixing my post Infopro. Unfortunately, the owner of the post said he "found the docs" but no indication where or what docs. I'm a newbie server admin. I now tried changing the php handler from DSO + mod_ruid2 to SuPHP (had to recompile to remove the mod_ruid2) as the post you referred to also said. As soon as it went live, all my sites broke with "No input file specified." scared me so switched back, and now a few of my clients are having upload file issues - basically same error as above with "open_basedir restriction in effect". I think it would also be worthwhile mentioning I'm also using config server scripts if that may influence it in any way? I found
    0
  • cPanelMichael
    Hello, Are you using a custom configuration where you are sharing files between multiple accounts? Note the option you are referring to is manageable via: "WHM Home " Security Center " PHP open_basedir Tweak" Thank you.
    0
  • dorac
    Thanks for the reply Michael. No, not sharing files between accounts at all. open_basedir is enabled. And after disabling it I get this on all my accounts:
    Warning: Unknown: open_basedir restriction in effect. File(/home/onyxsacc/public_html/index.php) is not within the allowed path(s): (0) in Unknown on line 0 Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/onyxsacc/public_html/index.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0
    0
  • cPanelMichael
    Are you using a custom php.ini file with that account? Is suPHP still the PHP handler? Thank you.
    0
  • dorac
    Thanks Michael. No custom php, current handler is DSO with RUID2
    0
  • cPanelMichael
    Is this only reproducible with WHMCS? I see you have opened a thread on the WHMCS forums, so you should receive a response to it shortly. Thank you.
    0
  • dorac
    No, it occurs on website with file upload as well. I posted it to WHMCS as well in hoped to get direction sooner.
    [05-May-2015 16:48:10 UTC] PHP Warning: Unknown: open_basedir restriction in effect. File(/home/printfyc/public_html/index.php) is not within the allowed path(s): (0) in Unknown on line 0 [05-May-2015 16:48:10 UTC] PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 [05-May-2015 16:48:10 UTC] PHP Fatal error: Unknown: Failed opening required '/home/printfyc/public_html/index.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0 [05-May-2015 16:48:11 UTC] PHP Warning: Unknown: open_basedir restriction in effect. File(/home/printfyc/public_html/index.php) is not within the allowed path(s): (0) in Unknown on line 0 [05-May-2015 16:48:11 UTC] PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 [05-May-2015 16:48:11 UTC] PHP Fatal error: Unknown: Failed opening required '/home/printfyc/public_html/index.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0
    0
  • dorac
    If I disable open_basedir, I get this on all of my sites.
    Warning: Unknown: open_basedir restriction in effect. File(/home/onyxsacc/public_html/index.php) is not within the allowed path(s): (0) in Unknown on line 0 Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/onyxsacc/public_html/index.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0
    0
  • cPanelMichael
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome. Thank you.
    0
  • dorac
    Already been on it, thanks Michael. I've spoken here, WHMCS, with my host that's also tried helping but they've been having serious network issues these last two days so their hands have been tied. 6462887
    0
  • dorac
    Answer from ticket: It appears that open_basedir had been activated on your server manually as well. In your php.ini file I found this: ========================================================= [20:45:53 cogit root@6462887 ~]cPs# grep -i basedir /usr/local/lib/php.ini ; open_basedir, if set, limits all file operations to the defined directory open_basedir = 0 ========================================================= However normally on a cPanel server, regardless of if open_basedir is enabled or not in cPanel, the same query looks like this: ========================================================= -bash-4.1# grep -i basedir /usr/local/lib/php.ini ; open_basedir, if set, limits all file operations to the defined directory ;open_basedir = ========================================================= As such, I backed up this file on your server, commented out that line, and restarted Apache. I used these commands to do this: ========================================================= [20:47:01 cogit root@6462887 ~]cPs# cp -p /usr/local/lib/php.ini{,_bak} ========================================================= [20:47:23 cogit root@6462887 ~]cPs# vi /usr/local/lib/php.ini ========================================================= [20:47:51 cogit root@6462887 ~]cPs# /scripts/restartsrv_httpd ========================================================= [20:48:02 cogit root@6462887 ~]cPs# grep -i basedir /usr/local/lib/php.ini ; open_basedir, if set, limits all file operations to the defined directory ;open_basedir = 0 =========================================================
    0
  • cPanelMichael
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.