Hi, I'm new to FTP using PHP. I need to ftp a remote server to retrieve and save a file to my local C: drive. The very first step I did is:
$ftp_server = "202.xxx.xxx.xxx"; //xxx will be replaced with remote server IP address
$conn_id = ftp_connect($ftp_server);
$ftp_user_name = "testuser";
$ftp_user_pass = "testuser";
I always failed to connect to the server. Hence, I tried using my own computer IP address and username & password, but the connection failed too. What's wrong with my code?
Please enlighten me.
Thank you.
Hi Bokeh and Chazzy, thank you for your reply. FYI, my Apache server has --enable-ftp option and the actual FTP server is running. I tried to connect to the remote server using a FTP software and it works well. In other words, there's problem with my php script. I really have no idea what goes wrong. Please help.
Thank you.
Bookmarks