Web Hosting Talk







View Full Version : phpinfo problem


vision3
01-22-2004, 12:44 AM
I ran phpinfo on my test site and i got this

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

Warning: Unknown(/home/test/public_html/phpinfo.php): failed to open stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening '/home/test/public_html/phpinfo.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0


and all of my other php files are saying the same thing, ehat does this means?

Sheps
01-22-2004, 12:47 AM
IS this your server? What type of server? Does it have a control panel? What version of PHP?

We will be able to help you more if we know these specifics.

vision3
01-22-2004, 12:51 AM
Yes its my server
Linux Server
Cpanel/WHM
PHP 4.3.3

vision3
01-22-2004, 10:49 AM
Well I figure out how to fix it. I search around this forum for an hour or two and found my solution. Here it is for those who would like to print it out.

Originally posted by titoboo
It's a cpanel 7.x problem that was fixed in Cpanel 8.x

Basically Cpanel 7.x sometimes created open_basedir entries with missing details.

eg. it has php_value instead of php_admin_value and it includes only /tmp path instead of /usr/local/lib/php etc. Look at one WORKING open_basedir entry (inside a vhost entry) and compare it to a non-working one.

If you're using Cpanel 8.4.x now, simply do the following:

1) cp /usr/local/apache/conf/httpd.conf httpd.conf-backup
2) Go into WHM as root, go into "Tweak Security", then the "open_basedir" section

Uncheck the box and click the save button. Cpanel will remove all open_basedir entries from httpd.conf

3) Now go again inside "tweak security" -> "open_basedir" and check/enable the feature and click the save button again.

Now cpanel will re-add the open_basedir entries again, but it won't have any missing/wrong entries like Cpanel 7.x used to create them.

Problem solved.

This has nothing to do with which PHP version you're using afaik. It's a Cpanel 7.x issue where it wasn't inserting the correct open_basedir entries correctly (it only messed up some vhosts, not all, but Cpanel 8.4x fixed this)

HTH

Great job titoboo :D