blank page all websites with open_basedir

YasIT

Active Member
Jan 3, 2014
38
0
6
cPanel Access Level
Root Administrator
Hello,
I was set the open_basedir = /home/:/usr/lib/php:/usr/local/lib/php:/tmp
but all sites blank page.
handler php : suphp
Enable php open_basedir Protection with Home »Security Center »PHP open_basedir Tweak.
php.ini disable for all users.
shared hosting..
 

cPanelMichael

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

Do you notice any error messages in /usr/local/apache/logs/error_log when opening the websites?

Thank you.
 

YasIT

Active Member
Jan 3, 2014
38
0
6
cPanel Access Level
Root Administrator
i turn on display_errors and show errors in the page :

Warning: Unknown: open_basedir restriction in effect. File(/home2/username/public_html/whmcs/cart.php) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Warning: Unknown: open_basedir restriction in effect. File(/home2/username/public_html/whmcs/cart.php) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) 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 '/home2/username/public_html/whmcs/cart.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0

Some sites are white, some are not.
 

YasIT

Active Member
Jan 3, 2014
38
0
6
cPanel Access Level
Root Administrator
open_basedir output for users should be like this.
/home/*user*:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp
What is the value of php.ini I enter?
 

YasIT

Active Member
Jan 3, 2014
38
0
6
cPanel Access Level
Root Administrator
some sites in /home2 show blank page....
fix by :

/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/home2/:/usr/lib/php:/usr/local/lib/php:/tmp:/home3/:/usr/lib/php:/usr/local/lib/php:/tmp:/home4/:/usr/lib/php:/usr/local/lib/php:/tmp

Thanks you.
 

Evolve

Well-Known Member
Jan 31, 2007
47
0
156
I believe I am having a related problem... or misunderstanding.

I was getting the blank pages with an error of "No input file specified." and since I recently added a new drive "home2" adding the /home2/:/usr/lib/php:/usr/local/lib/php:/tmp seemed to remedy that. Thanks.

My problem though was that I noticing that the default PHP settings I had through the PHP Configuration Editor weren't taking effect and this was reinforced by viewing phpinfo(). I had specifically set "display_errors" to "Off" in the editor and when there wasn't a php file put in the user's directory it was loading my default settings. As soon as I added a user specific php.ini file, which didn't change the display_errors setting, it changed the display_errors setting to be On for both Local and Master.

Aren't the master php settings made in the configuration editor inherited by the user made ones unless they are overwritten?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Aren't the master php settings made in the configuration editor inherited by the user made ones unless they are overwritten?
Yes, that is true for most configuration options, but not all. To clarify, are you stating the php.ini file within the account is changing the global php.ini settings for all other accounts?

Thank you.
 

Evolve

Well-Known Member
Jan 31, 2007
47
0
156
No just for that account however it's changing settings that it isn't even attempting to change. As soon as I add a user php.ini it appears to ignore any of the settings in the master php.ini.

It must be pulling those default settings from a new file as soon as I add a user php.ini file. For example when I add a user php.ini it changes memory_limit to 128M which is not what is set in either my master (64M) or my user (not set) php.ini files. Where is it getting 128M from?

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Make sure you copy the php.ini file from /usr/local/lib/php.ini rather than creating it as a new blank file.

Thank you.
 

Evolve

Well-Known Member
Jan 31, 2007
47
0
156
So I am to understand that this is the expected result from using suPHP?
The PHP Configuration Editor settings are rendered useless as soon as you add a php.ini file in a user's directory?
There is no way to set default settings for all accounts that can be overridden on a per account basis without entering every single setting in my php for each and every account?
That doesn't seem very intuitive.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I believe we could provide a more accurate answer if we were able to review your existing setup and see what's happening. Could you open a support ticket so we can take a closer look? You can provider the ticket number here so we can update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
To update, here is a snippet of the response from the analyst on the ticket:

Note that in PHP 5.3 and newer, there is a limited mechanism to perform per-directory configuration changes:

PHP: .user.ini files - Manual

This mechanism does inherit from the applicable PHP configuration.
Thanks.
 

Evolve

Well-Known Member
Jan 31, 2007
47
0
156
Just as a follow up:

The previous poster said to use:
/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/home2/:/usr/lib/php:/usr/local/lib/php:/tmp:/home3/:/usr/lib/php:/usr/local/lib/php:/tmp:/home4/:/usr/lib/php:/usr/local/lib/php:/tmp


Can it just be simplified down to: /home/:/usr/lib/php:/usr/local/lib/php:/tmp:/home2/:/home3/:/home4/
It seems like some of it is just repeated or am I confused about the colon being a separator?