The Code is as follows & amp; lt ;? Php {code...} results: {code...} Why does ftp_connetc return a bool (true )? As a result, ftp_login cannot be connected to ftp. The code for normal connection is as follows:
$ftpServer = "192.168.1.118";$ftpUser = "hqzn-ftp";$ftpPwd = "123456";$conn = ftp_connect($ftpServer) || die(printf("Couldn't connect to $s", $ftpServer));var_dump($conn);$login_result = ftp_login($conn, $ftpUser, $ftpPwd);
The result is as follows:
bool(true) Warning: ftp_login() expects parameter 1 to be resource, boolean given in C:\Users\hqzn\phpStudy\WWW\EasyDarwin\html\ftp.php on line 8
Why does ftp_connetc return a bool (true )?
As a result, ftp_login cannot connect to ftp
The ftp tool can be used for normal connection.
Reply content:
The Code is as follows:
$ftpServer = "192.168.1.118";$ftpUser = "hqzn-ftp";$ftpPwd = "123456";$conn = ftp_connect($ftpServer) || die(printf("Couldn't connect to $s", $ftpServer));var_dump($conn);$login_result = ftp_login($conn, $ftpUser, $ftpPwd);
The result is as follows:
bool(true) Warning: ftp_login() expects parameter 1 to be resource, boolean given in C:\Users\hqzn\phpStudy\WWW\EasyDarwin\html\ftp.php on line 8
Why does ftp_connetc return a bool (true )?
As a result, ftp_login cannot connect to ftp
The ftp tool can be used for normal connection.
Setftp_connect($ftpServer) || die(printf("Couldn't connect to $s", $ftpServer));
| Replace with or.
This is indeed the problem.
Thank you for your answers.