Jump to content
xisto Community
Carson

Open_basedir Issue

Recommended Posts

I use my Xisto account for a website and a forum. Both are a big part of the site, and community based. Members can add content to the website as well, and post on the forums. I need both softwares to be integrated, so members can register on the forums and be able to use their account for both the forum and the website. That is not the issue though, I have had them integrated, but since open_basedir was enabled, I'm obviously getting an error. For the forum to access the necessary files from the website, it needs to access them in a higher directory, which open_basedir does not allow. So if it stays like it is now, my members will have to make two accounts. Furthermore, I have to make all the content on the website viewable by all guests, just so members don't have to register twice. I would like to make some content on the site only viewable by members, but I cannot make them register twice. What are options here, if any? Is it simply impossible to get the integration of the two softwares to work?

Share this post


Link to post
Share on other sites

Can you give us information above the structure of these Application installations so that we might be able to assist you further? Where is the 'problem' file located now, for example. What is the Directory structure of the Applications? Is there a configuration file where you specify the structure or URLs? We need to know more than what you have supplied so far.Thanks.

Share this post


Link to post
Share on other sites

Ah, Okay. Well the website is located in the root folder(public_html), and the forum in a forums directory. So for example my website is located at mydomain.trap17.com/, and the forum at mydomain.trap17.com/forums/. The integration script has a configuration script for both the forums and website. The configuration script located in the forums directory requires a set physical path(which is "/public_html") and a URL to the website. I think this is where open_basedir comes into play. The other configuration script located in the websites directory is pretty much the same. It requires the physical path of the forum("/public_html/forums") and the URL. This is the actual error I'm getting:


Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/public_html/forums/bpforum/configuration.php) is not within the allowed path(s): in /home/marked/public_html/forums/bpforum/bpforumconfig.php on line 24 Warning: require_once(/public_html/forums/bpforum/configuration.php) [function.require-once]: failed to open stream: Operation not permitted in /home/marked/public_html/forums/bpforum/bpforumconfig.php on line 24


So I think it is trying to access the configuration file of the website, but doesn't have permission. The forum and website run fine until a member logs in or out, or when editing members etc.


Share this post


Link to post
Share on other sites

Place a copy of the website config file in the /forum sub-directory and change the information required in the website pages to find it there. The file needs to be opened by both softwares, right? so it needs to be in the lowest folder of the bunch. Any further questions, post back here.

Share this post


Link to post
Share on other sites

Thank you for your reply.


I do have a question though. The file that both softwares need to access is the configuration.php file. To setup the directory to access this, the code is:

require_once($bpfConfig['joomla_path'].DS."configuration.php");

I have this file(configuration.php) moved to forums/bpforum (bpforum being the sub-driectory of the forums directory, where one of the config files that access's configuration.php is located).

So how would I alter that line to point to the configuration.php file, and not being affected by base_opendir?

Share this post


Link to post
Share on other sites

I opened up some other php scripts to see how the require_once function works when retrieving files in the same directory. I managed to get it to work. Must be a coincidence I was able to get it working though.

This what I did:

define('CONF_BASE', dirname(__FILE__) );define( 'DS', DIRECTORY_SEPARATOR );require_once ( CONF_BASE .DS.'configuration.php' );

To check it was actually pointing to that actual configuration file, i changed the name in the script and got an error. Other things I tried I didnt get an error, but it wasn't pointing to any particular file either. I think all is working now.

Thanks for the help jlhaslip.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.