Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 21, 2013, 03:56 PM   #1
gustavopi
macrumors member
 
Join Date: Oct 2008
Listing directory for php

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?
gustavopi is offline   0 Reply With Quote
Old Sep 22, 2013, 04:21 PM   #2
ccamelot
macrumors member
 
Join Date: Feb 2010
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
ccamelot is offline   0 Reply With Quote
Old Sep 23, 2013, 02:31 PM   #3
gustavopi
Thread Starter
macrumors member
 
Join Date: Oct 2008
Quote:
Originally Posted by ccamelot View Post
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?
gustavopi is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
directory utility, file manager, php

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:02 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC