RE: [PHP] Directory Listing Problem

From: Date: Tue, 03 Oct 2000 08:44:51 +0000
Subject: RE: [PHP] Directory Listing Problem
Groups: php.general 
Request: Send a blank email to php-general+get-18384@lists.php.net to get a copy of this message
Is the absolute path from the root /tmp? or is it something along the /usr/home/mywebsite/tmp? Try putting in "$DOCUMENT_ROOT"./tmp Eg $handle=opendir($DOCUMENT_ROOT . '/tmp'); PHP runs under the same user as apache, and it doesn't generally see your web root as the absolute root, even if your ftp account does. cheers, Lawrence. -----Original Message----- From: Samantha Savvakis [mailto:samantha@cfs.net.au] Sent: October 3, 2000 04:43 PM To: PHP General Subject: [PHP] Directory Listing Problem Hi, I have run into a slight problem using the directory functions in PHP. Versions: * Apache/1.3.11 Ben-SSL/1.38 (Unix) * PHP/4.0.3-dev I have copied the details straight from the PHP Manual: <?php $handle=opendir('/tmp'); echo "Directory handle: $handle<BR>\n"; echo "Files:<BR>\n"; while (($file = readdir($handle))!==false) { echo "$file\n"; } closedir($handle); ?> I get the following output: ************ Directory handle: Resource id #1 Files: ************ No files are being displayed. Then I tried the "dir" class method. Again, code straight from the PHP manual: $d = dir("/tmp"); echo "Handle: ".$d->handle."<br>\n"; echo "Path: ".$d->path."<br>\n"; while($entry=$d->read()) { echo $entry."<br>\n"; } $d->close(); Output: *************** Handle: :Resource id #1 Path: /tmp *************** Again, no files listed. I have checked permissions on the directory. The apache user definitely has "read" access to the /tmp directory. Is there some sort of setting in the apache conf file that I need? 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 (#18384) next »