Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP内置FTP客户端的FileZIller服务器故障_Php_Ftp - Fatal编程技术网

PHP内置FTP客户端的FileZIller服务器故障

PHP内置FTP客户端的FileZIller服务器故障,php,ftp,Php,Ftp,我已经下载了ZF2,我正在使用这个库。此库可用于我们的暂存服务器,但问题在于本地配置的FTP服务器。如果我使用FileZile客户端,我可以进入本地文件服务器,但不能使用PHP 下面是我在一个测试类中的一行代码: $handler = $this->ns->connect( '127.0.0.1:54218' )->login( '***', '***' ); 当然,该线路与远程服务器一起工作,但与本地服务器一起工作 PHPUnit给了我以下错误: $ vendor/bin/

我已经下载了ZF2,我正在使用这个库。此库可用于我们的暂存服务器,但问题在于本地配置的FTP服务器。如果我使用FileZile客户端,我可以进入本地文件服务器,但不能使用PHP

下面是我在一个测试类中的一行代码:

$handler = $this->ns->connect( '127.0.0.1:54218' )->login( '***', '***' );
当然,该线路与远程服务器一起工作,但与本地服务器一起工作

PHPUnit给了我以下错误:

$ vendor/bin/phpunit
PHPUnit 5.3.4 by Sebastian Bergmann and contributors.

.E                                                    2 /(100%)

Time: 2.59 seconds, Memory: 8.25MB

There was 1 error:

  1) ApplicationTest\Service\RemoteClientConnectionTest::testRemoteClientConnection
     FtpClient\FtpException: Unable to connect

D:\web\www2\zend-file-manager\vendor\nicolab\
  php-ftp-client\src\FtpClient\FtpClient.php:162
D:\web\www2\zend-file-manager\module\SparkleRemoteClient\test\
 SparkleRemoteClientTest\Service\RemoteClientConnectionTest.php:22

FAILURES!
Tests: 2, Assertions: 1, Errors: 1.
同时,FileZile客户端给我以下输出:

Status: Connecting to 127.0.0.1:54218...
Status: Connection established, waiting for welcome message...
Status: Logged in
Status: Retrieving directory listing...
Status: Directory listing of "/" successful
我正在用Zend为我们的客户机构建一个文件管理器,我需要在本地设置一个FTP服务器,这样我就不会冒着在登台和/或直播服务器上做错事的风险


期待听到我在这里遗漏的内容。

请检查函数定义

public function connect($host, $ssl = false, $port = 21, $timeout = 90)
所以你需要使用类似

$handler = $this->ns->connect('127.0.0.1',false,54218)->login( '***', '***' );

请检查函数定义

public function connect($host, $ssl = false, $port = 21, $timeout = 90)
所以你需要使用类似

$handler = $this->ns->connect('127.0.0.1',false,54218)->login( '***', '***' );

谢谢你@Goerge这真是个好办法。我不知道我在想什么,因为我检查了函数定义,但我的解释没有让我想到这一点。再次感谢。@LuyandaSiko没问题,伙计,有时候我们都会这样;)另外,请不要忘记在GitHub上关闭该问题。祝您有个美好的一天!谢谢你@Goerge这真是个好办法。我不知道我在想什么,因为我检查了函数定义,但我的解释没有让我想到这一点。再次感谢。@LuyandaSiko没问题,伙计,有时候我们都会这样;)另外,请不要忘记在GitHub上关闭该问题。祝您有个美好的一天!