RE: [PHP] Directory Listing Problem

From: Date: Tue, 03 Oct 2000 23:19:11 +0000
Subject: RE: [PHP] Directory Listing Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-18488@lists.php.net to get a copy of this message
I logged in as "nouser" - which is my apache user. Changed the shell so I could log in. I did a directory listing of /usr, /tmp, /usr/local/apache, /etc .. and it keeps going. I created a file using the 'nouser' login, and checked that the file was owned by nouser. So it's not permissions. Why does the "ls -l" in the code work? It the nouser didn't have permissions, then that wouldn't work. When it comes to constraints - is there something in my php.ini or http conf file that I might be missing? To use the directory commands do I need to have compiled PHP with an extra switch? > -----Original Message----- > From: Mark Olbert [mailto:mark@arcabama.com] > Sent: Wednesday, 4 October 2000 09:11 > To: samantha@cfs.net.au; Lawrence.Sheed@dfait-maeci.gc.ca > Cc: php-general@lists.php.net > Subject: RE: [PHP] Directory Listing Problem > > > Are you running afoul of permission/access constraints? > > - Mark > > -----Original Message----- > From: Samantha Savvakis [mailto:samantha@cfs.net.au] > Sent: Tuesday, October 03, 2000 3:49 PM > To: Lawrence.Sheed@dfait-maeci.gc.ca > Cc: php-general@lists.php.net > Subject: RE: [PHP] Directory Listing Problem > > > Hi, > > Thanks to everyone for all their advice. > > It's still not reading the files in the directory. I put in the code that > Lawrence sent through. I added a printf statement in the GetDir > function to > just print out the path (shown in the code below). > > This is all the output I get when I call it like this: > > readdir.php?dir=/usr/local/apache/htdocs/intranet/quality > > ************************** > Path = /usr/local/apache/htdocs/intranet/quality > > Current Working Directory: /usr/local/apache/htdocs/readdir.php > ************************** > > This should be such a simple thing. Anyone know if this is a > problem in PHP > 4.0.3 dev? I might revert back to a different release of PHP4. > > > <?php > > > > function GetDir ($sPath) > > { > > printf("<BR>Path = %s<BR>", $sPath); > > $handle=opendir ($sPath); > > while ($file=readdir($handle)){ > > echo $file . "<br>"; > > } > > } > > > > if (!isset($dir)) { > > $dir="/tmp"; > > } > > > > GetDir ($dir); > > > > print "<br>Current Working Directory: " . $SCRIPT_FILENAME; > > > > ?> > > Thanks, > Sam > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#18488) next »