dongze8698 2011-04-03 19:32
浏览 150

PHP脚本和命令行中的FTP因553而失败,但Filezilla传输正常

I'm getting a weird FTP failure in a PHP script. I've recreated the failure just using command line FTP, so I think I can eliminate PHP from my enquiries.

Using command line FTP in Ubuntu 10.10, I can connect to my FTP server, log in, list directories, etc. However, when I try to transfer a file from my local machine to the FTP server using "put" I get a "553 Could not create file" error. I get the same error in active and passive modes. Transfer is set to binary.

When I run FileZilla on the same machine and connect to the same FTP server using the same credentials, and try to transfer the same file to the same destination directory, the transfer works just fine, after defaulting to binary and passive mode.

FWIW, the PHP script (which is a simple ftp_connect, ftp_login and ftp_put) using the same details fails with "Illegal PORT command", although I suspect this is just PHP's interpretation of the same error I get from command line FTP. Again, this error occurs in both active and passive FTP modes.

  • 写回答

1条回答 默认 最新

  • dongmei8511 2011-07-03 07:25
    关注

    FileZilla and ftp command probably starts in a different directories. You can setup starting remote directory in FileZilla and you have to go to the same location from command line.

    Try using pwd command after logging in from command line client, it will show current working directory, compare that with the one FileZilla is using and then go to the correct directory with a cd command.

    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀