Test FTP connection with PHP

后端 未结 6 943
独厮守ぢ
独厮守ぢ 2021-02-05 08:55

I am using the PHP script below to test FTP connections. Currently it is printing an array of the files, if it successfully connects.

How can I get it to also display

6条回答
  •  一整个雨季
    2021-02-05 09:14

    Hey. I'm new here so maybe posting this late answer is not welcome, but it may help people in the future.

    The reason why it's not working with MediaTemple is because they only accept passive connections.

    After logging in with ftp_login(), simply call ftp_pasv($ftp, TRUE); and you'll be set.

提交回复
热议问题