You are here: Re: ftp_nlist "425 Can't open data connectoin" « All PHP « IT news, forums, messages
Re: ftp_nlist "425 Can't open data connectoin"

Posted by Patrick Schlangen on 08/19/06 23:01

Hi,

> - How could I know if the FTP functions are enabled at PHP
> installation?

they are. Otherwise you would get a error about a undefined function.

> - How to make the FTP functions work?

You might need to use PASSIVE ftp mode (e.g. because of firewall or NAT
settings).
Just try this:

#! /usr/bin/php
<?php
$ftp_server = "myftpserver";
$connect = ftp_connect($ftp_server)
or die("Couldn't connect to $ftp_server.");
$result = ftp_login($connect, "myftpuser", "mypassword")
or die("Couldn't log in $ftp_server.");
ftp_pasv($connect, true);
$a = ftp_nlist($connect, "/");
foreach($a as $value){
echo $value, "\n";
}
?>

I just added one line (""ftp_pasv($connect, true);"").
Please let us know if it works now.

Patrick

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация