I am trying to use FTP from my PHP program to read a directory.
ftp_nlist returns Bool(False)
Some PHP sites suggest to set ftp_pasv to TRUE after the login, when I do that now I get tihs error:
Warning: ftp_nlist() [function.ftp-nlist]: php_connect_nonb() failed: Operation now in progress (115) in ....php on line 43
Thanks
---------- Post added at 07:01 PM ---------- Previous post was at 06:01 PM ----------
Sorry, forgot to include the code sample:
This gives me a timeout (after 10 seconds):
Warning: ftp_nlist() [function.ftp-nlist]: php_connect_nonb() failed: Operation now in progress (115) in /home/elohim/public_html/pkStats/load_xml.php on line 42
bool(false)
If I comment out the ftp_pasv lines, then I get (immediately):
bool(false)
Any ideas?
Thanks
ftp_nlist returns Bool(False)
Some PHP sites suggest to set ftp_pasv to TRUE after the login, when I do that now I get tihs error:
Warning: ftp_nlist() [function.ftp-nlist]: php_connect_nonb() failed: Operation now in progress (115) in ....php on line 43
Thanks
---------- Post added at 07:01 PM ---------- Previous post was at 06:01 PM ----------
Sorry, forgot to include the code sample:
PHP:
$fconn_id = ftp_connect($ftp_host);
$login = ftp_login($fconn_id, $ftp_user, $ftp_password);
ftp_set_option($fconn_id, FTP_TIMEOUT_SEC, 10);
$mode = ftp_pasv($fconn_id, TRUE);
if ((!$fconn_id) || (!$login) || (!$mode)) {
die("FTP connection failed.");
}
$mode = ftp_pasv($fconn_id, TRUE);
$file_list = ftp_nlist($fconn_id, ".");
var_dump($file_list);
ftp_close($fconn_id);
This gives me a timeout (after 10 seconds):
Warning: ftp_nlist() [function.ftp-nlist]: php_connect_nonb() failed: Operation now in progress (115) in /home/elohim/public_html/pkStats/load_xml.php on line 42
bool(false)
If I comment out the ftp_pasv lines, then I get (immediately):
bool(false)
Any ideas?
Thanks