dongyong8071 2014-12-03 12:27
浏览 78

ftp_put()函数问题。 得到警告。 如何解决这个问题?

I'm trying to connect to some other FTP server using PHP and upload a file to it.

On my local machine the code is working absolutely fine but when I run this code from my staging server I got following warning and I'm not able to communicate with the FTP server.

Following is the warning I got.

Warning: ftp_put() [function.ftp-put]: I won't open a connection to 10.140.166.143 (only to 52.232.262.219) in /code/sites/my_web/model/Request.php on line 193

52.232.262.219 is the ip address of my staging server.

The line 193 is as follows:

$file_upload_status = ftp_put($conn_id, $remote_file, $file, FTP_BINARY);

Note: I'm not putting all the code since it's working from my local machine. It's not working only from the staging server.

Is this happening due to the settings in php.ini file. Since php.ini file on my local might have some different setting for this than the php.ini file present on staging server.

  • 写回答

2条回答 默认 最新

  • dql7588 2014-12-03 12:32
    关注

    FTP server only accepts connections from the IP address 52.232.262.219 and your IP is 10.140.166.143 :(

    See the configuration of your ftp server

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?