ftp - PHP script won't connect but FileZilla works -
i have weird problem cannot seem figure out. have purchased godaddy web server enables me connect remotely, via ftp. when use filezilla
connect, allows me , can roam files @ leisure. have written php
script connect server, same information , not allow me too. gives me error such cannot connect ftp server
(has seen in script). have tried remove port , timeout, , still nothing. have figured out, however, initial connection failing (as commented). lost @ why not allowing me filezilla works.
// connect , login ftp server $ftp_server = "ip"; //it not pass here, error happens right here $ftp_conn = ftp_connect($ftp_server, "21","90") or die("could not connect $ftp_server"); $login = ftp_login($ftp_conn, "user", "pass"); $file = "test.txt"; // upload file if (ftp_put($ftp_conn, "serverfile.txt", $file, ftp_ascii)) { echo "successfully uploaded $file."; } else { echo "error uploading $file."; } // close connection ftp_close($ftp_conn);
this echoed me trycatch
warning: ftp_login() expects parameter 1 resource, boolean given in /home/content/85/9844385/html/test/upload/upload.php on line 7 warning: ftp_put() expects parameter 1 resource, boolean given in /home/content/85/9844385/html/test/upload/upload.php on line 12 error uploading test.txt. warning: ftp_close() expects parameter 1 resource, boolean given in /home/content/85/9844385/html/test/upload/upload.php on line 22
Comments
Post a Comment