注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

@fc_lamp

关注Web应用解决方案MySql/PHP/Python一盏名为"飞川"的灯~

 
 
 

日志

 
 

ftp_put(): Illegal PORT command Warning: ftp_put(): Could not create file ftp_put(): Security: Bad IP connecting  

2013-02-27 15:57:19|  分类: Web技术-Php |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
PHP FTP 文件上传报错:
一  ftp_put(): Illegal PORT command
      一般原因(来源:http://board.phpbuilder.com/showthread.php?10218096-FTP-problems)
          Basically, when you make an FTP connection to a server, your FTP client connects to port 21 on the server. This connection is the 'control' channel for FTP. No data is actually transfered through this port. The control channel allows you to send commands to the FTP server and back while keeping the actual data on a different port. Once the control channel has been setup, then the data channel can be setup and data transfer can be started. 

How the data port is setup depends on which FTP mode you are using. There are two basic modes of operation for an FTP connection 'active' and 'passive'. Essientally, active means that the client tells the server what port it will use for data and passive means that the server will specify what port on the client to use. 

The PORT command is used in active mode for the client to specify which port (on the client) to use for data transfer.

This is only the basics and I am sure to get flamed by the gods of FTP, but maybe you will have a bit more understanding of FTP now.

I assume you are using active transfer mode and there is a firewall between your two machines and this is why you are getting that error.

    解决方法:
             使用: ftp_passv()或者指定端口 ,详见  http://www.php.net/manual/en/function.ftp-pasv.php


二  Warning: ftp_put(): Could not create file
          一般原因程序读取 源文件与目标文件 的权限不足,或者目录路径不正确。
           解决方法:给予足够的权限,查看目录是否正确。


三  ftp_put(): Security: Bad IP connecting
      一般原因这个错误是我在同台服务器上进行文件FTP传输时出现的,原因是FTP 的HOST我使用的是对外IP地址。当我修改为本地IP地址时,正确。
      解决方法:将IP修改为:127.0.0.1


另外要注意是的:本地开发环境与服务器环境区别很大。


更多待补充。。。。。。。。。。

    
  评论这张
 
阅读(1347)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017