opendir

From: Date: Tue, 15 Mar 2005 23:25:10 +0000
Subject: opendir
Groups: php.general 
Request: Send a blank email to php-general+get-210859@lists.php.net to get a copy of this message
So that I could use the opendir feature with an ftp url, I downloaded php-5.0.3 and used the following to make the cgi version: ./configure --enable-ftp make cp ./sapi/cgi/php /root Here is my script: ----start of script /root/z.php---- #!/root/php <?php if ($handle = opendir('ftp://login:password@xxx.xxx.xxx.xxx/SHARE1/')) { echo "Directory handle: $handle\n"; echo "Files:\n"; while (false !== ($file = readdir($handle))) {
    echo "$file\n";
} closedir($handle); } ?> ----end of script---- When I run the script, I get the following error. I am root doing this and can ftp normally into the server with ncftp. I have another script (shell script /bin/sh) that I have been doing ftp with, but want some added features that php 5.0.3 will allow. ----start z.php output----- # /root/z.php Content-type: text/html X-Powered-By: PHP/5.0.3 <br /> <b>Warning</b>: opendir(ftp://...@xxx.xxx.xxx.xxx/SHARE1/) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: not implemented in <b>/root/z.php</b> on line <b>3</b><br /> ----end z.php output---- Any help in this would be greatly appreciated. I really would like to get this running. I am assuming that there is a compile option that I need to add. Thanks Steve

« previous php.general (#210859) next »