Reputation:
$contentdirectory = '/dead-wave/dead-wave_content';
$contentlaunch = scandir($contentdirectory);
that's what I'm using to create an array from which I echo it's values using a for each statement. this works perfectly on my dedicated server, but once hosted on godaddy servers returns an error message 'failed to open dir: No such file or directory in...' now the directory path is certainly correct the actual problem is unknown to me. Any Thoughts?
Upvotes: 3
Views: 12320
Reputation: 11907
I'm not sure this is the same problem you're having but sometimes I can't use any file i/o functions when I'm running unit tests on top of Zend Server via Zend Studio even though they worked on Apache.
I think you need to rewrite you paths somehow making them relative to the server web directory constant. I'm not sure what that is but I'm sure there is one.
EDIT Oh! I don't think Apache recognizes '/toplevel/secondlevel' path writing style.
Upvotes: 0
Reputation: 9671
are you sure the path is correct? on a hosting you are usually rooted to a different directory (like /home/user1
).
So the Path from above would be /home/user1/dead-wave/dead-wave_content/
you can do a
exec('pwd',$return);
print_r($return);
to find out where you actually are.
Upvotes: 1
Reputation: 1405
Are you sure the path is correct? If the path is a subdirectory of your current directory, you should use 'dead-wave/dead-wave_content' instead of '/dead-wave/dead-wave_content'.
Upvotes: 4