Page 1 of 1

opendir(http://etc.): failed to open dir: not implimented

Posted: Tue May 17, 2005 6:16 pm
by mikebr
I am having a problem with opendir and wonder if there is a way around this.

The error is:

Warning: opendir(http://loconation.users39.thehost.co.uk ... nbins/bin1): failed to open dir: not implemented in /home/x/y/locono/public_html/site/php_bin/get_folders.php on line 25

Line 25 is:

Code: Select all

if( !$dirContents = opendir($paths['ftphost'] . $paths['binsfolder'] . "/$suiteBin")) {
	$ua = "<FONT COLOR=RED><B>There was a problem opening the directory.<FONT></B>";
	} else {
// Run code
}
I think the reason is I am trying to access account1 from account2 on the same server using a php script and opendir() seems to through the "not implemented" error, I guess because the server does not permit this access, is there a way I can get around this? I need to count and check file types of files on the other server directory?

Thanks

Posted: Tue May 17, 2005 6:51 pm
by SBro
Yeah you can't open a directory using the opendir() command that isn't on your server. I think the ftp commands would be more suited for this purpose. They are all pretty self explanitory and can be found in the manual here

Posted: Wed May 18, 2005 2:00 am
by Chris Corbyn
You can't read directories over HTTP, you can only read the document the server sends by HTTP.

The way to do what you are trying to achieve *would* be to use the full server path e.g. "/home/account1/public_html/folder/" but then it comes down to security permissions permitting that access to the other account.

As already mentioned, if both accounts are yours the FTP functions will do nicely. You just connect to ftp://localhost with your username and password and yippee, you have access.

Good Luck!

Posted: Wed May 18, 2005 2:29 am
by mikebr
Yes that is correct, it is not possible to use the full server path. I have set up two accounts on the same server, a main account called account1 where the site is, and a second account called account2 so when the ftp's the account they can't see other directories such as the site folder as it won't exist.

I will take a look into using ftp://localhost

Thanks for the replies