MyBB Community Forums

Full Version: Warning [2] require() [function.require]: open_basedir restriction in effect.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm running version 1.6.9.
Recently (i did not do any changes), an error started to appear on all pages:
Warning [2] require() [function.require]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/ommd/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php53/lib/php/) - Line: 90 - File: inc/class_language.php PHP 5.3.29 (Linux)

/inc/class_language.php 	90 	errorHandler->error
/inc/class_language.php 	90 	MyLanguage::set_language
/global.php 	95 	MyLanguage->set_language
/index.php 	18 	require_once
See here:

Any ideas i could do, or should i contact the hosting company.

It looks like your host has recently changed the "open_basedir" configuration for PHP, so that only files in the following paths can be included: "/home/ommd/", "/tmp", "/var/tmp/", "/usr/local/lib/php/" and "/usr/local/php53/lib/php/".

You will have to contact your host to ensure this is changed back to the previous settings or to fix the current configuration.
Thanks for reply, i have contacted my hosting, but just in case they reply I'll have to fix the current configuration, what exactly should i fix?
Thanks a lot.
You'll have to edit the php.ini file, and change the "open_basedir" setting to either be disabled or to include your forum path as an allowed path.
I've been told by server admin that open_basedir settings for my server are correct, and are settled by admin, so they can't be changed by each client.

The problem is that the script itself doesn't detect properly the path, which instead of being:

is actually:

So if you take a look into inc/class_language.php at line 90, you see:
require $this->path."/".$language.".php";
The $this->path value isn't settled, is null.

So I've bee told to look here for the solution.
Please help.
That's strange, because the path is set very early on in the initialisation process, which all files in the MyBB core carry out:

Are you sure it's not set? Have you tried dumping the path?
Just looked into class_language.php, and at line 90 i see this:

require $this->path."/".$language.".php";

May be i don't understand something, sorry.

If that's helpful, as soon as i switch to PHP version 5.2 the error disappear.
Strange, I wonder if the host has different configurations between PHP versions. If so, that's a very odd approach. Which host are you with?
Probably it does, its a local hosting company.

Is there a solution to my issue?

If that's helpful, here's the PHP info:

Hate to bump threads, but this one kind of stack in the air, so i was wondering if there's any solution to my issue beside downgrading the PHP to an obsolete version.
Pages: 1 2