Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gustavopi

macrumors regular
Original poster
Oct 29, 2008
155
29
Brazil
Hi. I'm trying to make a simple photo listing app for my intranet using php. My photos are in an external HD mounted as a Volume, so no permission issues, I can even read those files using simple php file_get_contents function, however, can't obtain a file listing and subdirectories.

I'm using my own library to read directories basically using opendir and a pointer and it works fine INSIDE apache's root. Outside, it returns a big nothing, I mean, not even an error, just nothing!

Any ideas?
 

ccamelot

macrumors member
Feb 21, 2010
33
0
Poland
opendir outside server root?

Hi,

it should be really simple. For instance make a symlink for your external dir in your server root directory or just use complete path eg. "/Volumes/Your Externall HDD/Your Folder/...". And be sure that the directory (and volume) can be read by _www (apache user). Or try to run your script from commandline as root (sudo php path_to_your_script.php).

hope this helps
 

gustavopi

macrumors regular
Original poster
Oct 29, 2008
155
29
Brazil
Hi,

it should be really simple. For instance make a symlink for your external dir in your server root directory or just use complete path eg. "/Volumes/Your Externall HDD/Your Folder/...". And be sure that the directory (and volume) can be read by _www (apache user). Or try to run your script from commandline as root (sudo php path_to_your_script.php).

hope this helps

I'm using complete path. By your answer, a symlink is interesting but depends on permissions either, right? When I try to add other users by clicking in the "+" button below _www doesn't appears. I guess I'll have to use the Terminal, right?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.