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

Similar Threads
thread Thread Starter Forum Replies Last Post
[php] - php problems os x mountain lion 10.8.2 cakas6933 OS X 10.8 Mountain Lion 4 Jun 10, 2014 08:08 AM
copy a directory using bash - how to do it? error: is a directory (not copied). cupboy1 OS X 10.8 Mountain Lion 0 Mar 23, 2014 09:50 PM
Listing of movies -- help please elgrecomac iOS 7 3 Sep 21, 2013 08:31 PM
Migrating directory listing in Finder to Pages orbdrums Mac Basics and Help 3 Feb 13, 2013 11:36 PM

Forum Jump

All times are GMT -5. The time now is 05:28 PM.

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

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