MyBB Community Forums
Warning [2] require() [function.require]: open_basedir restriction in effect. - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Warning [2] require() [function.require]: open_basedir restriction in effect. (/thread-170691.html)

Pages: 1 2


Warning [2] require() [function.require]: open_basedir restriction in effect. - azmandius - 05-15-2015

Hello,
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: http://om.md/board

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


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - Euan T - 05-15-2015

Hi,

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.


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - azmandius - 05-15-2015

Hi,
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.


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - Euan T - 05-15-2015

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.


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - azmandius - 05-18-2015

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:
/home/my_directory/domains/my_directory/public_html/my_directory/inc/class_language.php

is actually:
/inc/class_language.php

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.
Thanks!


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - Euan T - 05-18-2015

That's strange, because the path is set very early on in the initialisation process, which all files in the MyBB core carry out: https://github.com/mybb/mybb/blob/feature/inc/init.php#L154

Are you sure it's not set? Have you tried dumping the path?


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - azmandius - 05-18-2015

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.


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - Euan T - 05-18-2015

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?


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - azmandius - 05-18-2015

Probably it does, its a local hosting company.

Is there a solution to my issue?

If that's helpful, here's the PHP info: http://om.md/board/phpinfo.php

Thanks!


RE: Warning [2] require() [function.require]: open_basedir restriction in effect. - azmandius - 05-20-2015

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.
Thanks.