FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


open_basedir restriction...





Tartaglia
I'm trying to get an update system to work on my website where the main index.php file gets the last 5 update files from a directory called '/archives/' and displays them. I believe I have a script that will work, but when I look at the page, I get the following message:

Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/archives/) is not within the allowed path(s): (/home/myusername/:/tmp/:/var/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/) in /home/myusername/domains/mydomain/public_html/admin/index.php on line 50

I'm guessing that only the host can fix this problem, so I was wondering if there was anything you could do about it? any hel or information would be helpful.
mathiaus
Will the full path work? ie. /home/you/domain.com/public_html/archives or even maybe './archives' Question
Tartaglia
Well, I tried the full path, and while that did get rid of the opendir error, a readdir error came up saying that it wasn't a valid directory. I hadn't tried ./archives yet, but when you suggested it, I tried it first thing and got this error:

Warning: opendir(./archives) [function.opendir]: failed to open dir: No such file or directory in /home/myusername/domains/mydomain/public_html/admin/index.php on line 49

So, yeah, I'm at a bit of a loss here, but if you have any other suggestion, I'd be open to them as well!
m-productions
Tartaglia wrote:
Well, I tried the full path, and while that did get rid of the opendir error, a readdir error came up saying that it wasn't a valid directory. I hadn't tried ./archives yet, but when you suggested it, I tried it first thing and got this error:

Warning: opendir(./archives) [function.opendir]: failed to open dir: No such file or directory in /home/myusername/domains/mydomain/public_html/admin/index.php on line 49

So, yeah, I'm at a bit of a loss here, but if you have any other suggestion, I'd be open to them as well!



he didnt mean put in "myusername" and "mydomain" you need to fill those out with YOUR information, so for me

/home/m-productions/domains/m-productions.frih.net/public_html/....ect

fill the information out with your info


edit: At least i think you do.. now that i look into it... ummm not sure >>
Tartaglia
I know, I just edited the path when I posted it for security purposes.
Daniel15
Tartaglia wrote:
Well, I tried the full path, and while that did get rid of the opendir error, a readdir error came up saying that it wasn't a valid directory.

What was the exact error message you got? Using a path of /home/myusername/domains/mydomain/public_html/archives/ (with the correct information of course) should work fine...
Tartaglia
Warning: readdir(): supplied argument is not a valid Directory resource in /home/name/domains/subdomain.frih.net/public_html/admin/index.php on line 50
Daniel15
Tartaglia wrote:
Warning: readdir(): supplied argument is not a valid Directory resource in /home/name/domains/subdomain.frih.net/public_html/admin/index.php on line 50

Hmmm... It should definitely be working Confused

Try this:
Code:

<?php
$handle = opendir('/home/name/domains/subdomain.frih.net/public_html/archives');

while (false !== ($file = readdir($handle)))
{
   echo $file, '<br />';
}

closedir($handle);
?>


Otherwise, if that does not work, try the dir class instead:
Code:

<?php
$d = dir('/home/name/domains/subdomain.frih.net/public_html/archives');

while (false !== ($entry = $d->read()))
{
   echo $entry, '<br />';
}
$d->close();
?>
Tartaglia
Well, I see by something in your code why I got the readdir error I did, and as soon as I corrected, that particular error went away. While I still have erro messages, none relate to the title of this topic anymore. So thanks for the help!
Related topics
oscommerce help
[php] including from lib folder impossible
php - access root directory
[RESOLVED] php file upload problem
MySQL Database not allowed
[help] problemas al instalar joomla en mi host
Writing to file
Please help. php script installation error
phpBB problems. Please help me solve the problem
Password Protected Directories
problems with phpBB2 forum
Opendir not working right for me.
Upload file porblem {fixed}
Problem after phpBB installation, cant enter panel admin
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.