I get the ------'Warning: php_hostconnect: connect failed in f:\program\uploadfile\ftp.php on line 8' when I use the ftp functions to upload a file whose size is more than 7M.I have set enough time to execute the php script and ftp connection.The following is the program:
function connect()
{
global $server, $username, $password;
$conn = ftp_connect($server);
ftp_login($conn, $username, $password);
return $conn;
}
$result = connect();
if ($action == "uploadfile")
{
ftp_chdir($result, $cdir);
$res_code = ftp_put($result, $upfile_name, $upfile, FTP_BINARY);
if ($res_code == 1)
echo "success";
else
echo "failed";
}
ftp_quit($result);
Why?Thanks a lot! 😕