I am unable to successfully ftp_connect to Apache server on my local machine using localhost (I also tried 127.0.0.1). The code works when I place it on my ISP's production server and replace localhost with my the production address. Please help me with this localhost problem.

$host="localhost";
$conn = ftp_connect("$host");
if (!$conn)
{
echo "Error: Could not connect to ftp server<br>";
exit;
}
echo "Connected to $host.<br>";

    Apache is a web server...not a FTP server...

    Diego

      Regardless of semantics, ftp_connect() opens up a FTP connection to the specified host. Once the connection is made, files can be uploaded to the server using functions such as ftp_put.

        Diego, do you know how to resolve the problem? Thanks.

          6 days later

          Diego,

          More specifically, do you know of a good free ftp server to use with Apache and PHP? Thanks.

            Write a Reply...