John
John

Reputation: 437

ftp_ssl_connection via php

Why when I'm trying to do:

$conn_id=ftp_ssl_connect($ftp_server);
$login_result=ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
echo ftp_pwd($conn_id);
ftp_close($conn_id);

I get the following errors:

Warning: ftp_login() expects parameter 1 to be resource, boolean given in /home/...
Warning: ftp_pwd() expects parameter 1 to be resource, boolean given in /home/....
Warning: ftp_close() expects parameter 1 to be resource, boolean given /home/...

Upvotes: 0

Views: 1037

Answers (2)

Dan Simon
Dan Simon

Reputation: 13137

That means that ftp_ssl_connect returned false instead of a connection resource. So likely either your $ftp_server url is incorrect, the server is refusing your connection, or there's some other connection error happening.

Upvotes: 2

Raffael
Raffael

Reputation: 20045

Because ftp_ssl_connect returns FALSE.

Returns a SSL-FTP stream on success or FALSE on error.

Upvotes: 0

Related Questions