Page 1 of 1

ftp_ssl_connect() Anyone with this working?

PostPosted: 07. April 2007 17:25
by wonderm00n
Hi there,

I've downloaded the last version of Xampp and the function ftp_ssl_connect() does not work either in PHP4 or PHP5.

I read that it's something related to the fact the binary wasn't compiled with SSL support... But... Does anyone has the binary compiled so I can use it?

Or any other solution?

PostPosted: 07. April 2007 17:34
by Wiedmann
Or any other solution?

Don't use the ftp extension. Just use the normal filesystem/directory functions.

PostPosted: 07. April 2007 17:40
by wonderm00n
Wiedmann wrote:
Or any other solution?

Don't use the ftp extension. Just use the normal filesystem/directory functions.


How can I use the normal "filesystem/directory" functions to login to a remote FTP (requires SSL) and list it's contents? I can't... Or... Can I?

PostPosted: 07. April 2007 17:45
by Wiedmann
How would you do this on your local filesystem?

PostPosted: 07. April 2007 17:55
by wonderm00n
Wiedmann wrote:How would you do this on your local filesystem?


Code: Select all
//List files in a directory
   function dirList ($directory) {       
       // create an array to hold directory list
       $results = array();
       // create a handler for the directory
       $handler = opendir($directory);
       // keep going until all files in directory have been read
       while ($file = readdir($handler)) {
           // if $file isn't this directory or its parent,
           // add it to the results array
           if ($file != '.' && $file != '..')
               $results[] = $file;
       }
       // tidy up: close the handler
       closedir($handler);
       sort($results);
       //folders first
       foreach($results as $temp) {
          if (is_dir($directory."/".$temp)) {
             $files[]=$temp;
          }   
       }
       //files right after folders...
       foreach($results as $temp) {
          if (!is_dir($directory."/".$temp)) {
             $files[]=$temp;
          }   
       }                   
       // done!           
       return $files;               
   }

print_r(dirList('/path/to/the/folder/name'));

PostPosted: 07. April 2007 18:01
by Wiedmann
What all is a valid value for the first opendir() parameter?

PostPosted: 07. April 2007 18:08
by wonderm00n
Wiedmann wrote:What all is a valid value for the first opendir() parameter?


In the opendir I use a string... with the directory path.

PostPosted: 07. April 2007 18:14
by Wiedmann
with the directory path.

That is one valid value.

I think you should read the PHP manual about opendir(), other filesystem function and stream wrappers?

PostPosted: 07. April 2007 18:21
by wonderm00n
The problem is the same... No OpenSSL, no SSL on FTP!

I can use scandir() like this:
Code: Select all
print_r(scandir('ftp://user:pass@server:port/'));

and it works.

But not like this:
Code: Select all
print_r(scandir('ftps://user:pass@server:port/'));


And the server I need to connect to requires SSL, so the problem is the same... When I can get OpenSSL to work I'll be able to use both methods: FTP or Filesystem functions.

PostPosted: 07. April 2007 21:46
by Wiedmann
Well, there is some problem (bug?) in the ftps wrapper from PHP. (I must ask the PHP developers what happens.)

PostPosted: 08. April 2007 16:45
by wonderm00n
The main issue is... Does anyone is able to use the ftp_ssl_connect() function? If so, what's needed to be done to achieve this?

PostPosted: 11. April 2007 09:18
by caglar
All of the sources I found says that you should compile from the source, is there anybody out there who had worked the ftp_ssl_connect before and how?