<small id='8ePSK'></small><noframes id='8ePSK'>

      <i id='8ePSK'><tr id='8ePSK'><dt id='8ePSK'><q id='8ePSK'><span id='8ePSK'><b id='8ePSK'><form id='8ePSK'><ins id='8ePSK'></ins><ul id='8ePSK'></ul><sub id='8ePSK'></sub></form><legend id='8ePSK'></legend><bdo id='8ePSK'><pre id='8ePSK'><center id='8ePSK'></center></pre></bdo></b><th id='8ePSK'></th></span></q></dt></tr></i><div id='8ePSK'><tfoot id='8ePSK'></tfoot><dl id='8ePSK'><fieldset id='8ePSK'></fieldset></dl></div>

    1. <tfoot id='8ePSK'></tfoot>
      <legend id='8ePSK'><style id='8ePSK'><dir id='8ePSK'><q id='8ePSK'></q></dir></style></legend>

        <bdo id='8ePSK'></bdo><ul id='8ePSK'></ul>
      1. PHP ftp_nlist 不工作

        时间:2023-10-30
          <bdo id='sgZqw'></bdo><ul id='sgZqw'></ul>
            • <i id='sgZqw'><tr id='sgZqw'><dt id='sgZqw'><q id='sgZqw'><span id='sgZqw'><b id='sgZqw'><form id='sgZqw'><ins id='sgZqw'></ins><ul id='sgZqw'></ul><sub id='sgZqw'></sub></form><legend id='sgZqw'></legend><bdo id='sgZqw'><pre id='sgZqw'><center id='sgZqw'></center></pre></bdo></b><th id='sgZqw'></th></span></q></dt></tr></i><div id='sgZqw'><tfoot id='sgZqw'></tfoot><dl id='sgZqw'><fieldset id='sgZqw'></fieldset></dl></div>
              <tfoot id='sgZqw'></tfoot>

              <small id='sgZqw'></small><noframes id='sgZqw'>

                  <legend id='sgZqw'><style id='sgZqw'><dir id='sgZqw'><q id='sgZqw'></q></dir></style></legend>
                    <tbody id='sgZqw'></tbody>

                  本文介绍了PHP ftp_nlist 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
                  
                  if (@ftp_login($ftp_conn, $ftp_username, $ftp_userpass))
                  {
                      $path = "./";
                      $path1="./test";
                      $file = "test.txt";
                      $file_list = ftp_nlist($ftp_conn,$path);
                  }
                  // close connection
                  ftp_close($ftp_conn);
                  

                  以上是我正在使用的代码.它在我的 Windows 本地机器、Windows 服务器机器、Linux 本地机器上运行良好,但不知何故它在 Linux 服务器机器上失败了.ftp_nlist 返回 false.谁能告诉我可能是什么原因?

                  The above is the code which I am using. It is working fine for me on my Windows local machine, Windows server machine, Linux local machine, but somehow it fails on the Linux server machine. ftp_nlist returns false. Can someone tell me what might be the reason?

                  任何帮助表示赞赏.谢谢.

                  Any help appreciated. Thank you.

                  推荐答案

                  ftp_nlist(或任何其他传输命令,如 ftp_getftp_put, ftp_rawlist) 是PHP默认的FTP主动模式.在 99% 的情况下,必须切换到 FTP 被动模式才能使传输正常工作.使用 ftp_pasv 函数.

                  Most typical cause of problems with ftp_nlist (or any other transfer command like ftp_get, ftp_put, ftp_rawlist) is that PHP defaults to the FTP active mode. And in 99% cases, one has to switch to the FTP passive mode, to make the transfer working. Use the ftp_pasv function.

                  $connect = ftp_connect($ftp) or die("Unable to connect to host");
                  ftp_login($connect, $username, $pwd) or die("Authorization failed");
                  // turn passive mode on
                  ftp_pasv($connect, true) or die("Passive mode failed");
                  

                  另请参阅我的文章,了解 主动和被动 FTP 连接模式.

                  See also my article on the active and passive FTP connection modes.

                  这篇关于PHP ftp_nlist 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 PHP 中的两个远程 FTP 服务器之间传输文件 下一篇:ftp_put():无法打开那个文件:没有那个文件或目录

                  相关文章

                      <small id='m2Y9K'></small><noframes id='m2Y9K'>

                      <i id='m2Y9K'><tr id='m2Y9K'><dt id='m2Y9K'><q id='m2Y9K'><span id='m2Y9K'><b id='m2Y9K'><form id='m2Y9K'><ins id='m2Y9K'></ins><ul id='m2Y9K'></ul><sub id='m2Y9K'></sub></form><legend id='m2Y9K'></legend><bdo id='m2Y9K'><pre id='m2Y9K'><center id='m2Y9K'></center></pre></bdo></b><th id='m2Y9K'></th></span></q></dt></tr></i><div id='m2Y9K'><tfoot id='m2Y9K'></tfoot><dl id='m2Y9K'><fieldset id='m2Y9K'></fieldset></dl></div>

                      <tfoot id='m2Y9K'></tfoot>
                    1. <legend id='m2Y9K'><style id='m2Y9K'><dir id='m2Y9K'><q id='m2Y9K'></q></dir></style></legend>
                        <bdo id='m2Y9K'></bdo><ul id='m2Y9K'></ul>