<tfoot id='MZLH2'></tfoot>
    1. <small id='MZLH2'></small><noframes id='MZLH2'>

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

    2. PHP FTP ftp_nlist 不起作用,返回布尔值 false

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

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

              <tbody id='zjwmF'></tbody>

                <bdo id='zjwmF'></bdo><ul id='zjwmF'></ul>

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

                问题描述

                我对这段代码有点问题.脚本连接,但它不会给我位于根目录的文件夹......我错过了什么?

                I have a little problem with this pice of code. The script connects, but it wont give me the folders that are located in root ... i am missing something?

                    $ftp_server = "ftp.something.com";
                    $ftp_user = "user";
                    $ftp_pass = "pass";
                
                    // set up a connection or die
                    $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); 
                
                    // try to login
                    if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) 
                    {
                        echo "Connected as $ftp_user@$ftp_server
                ";
                    } 
                    else 
                    {
                        echo "Couldn't connect as $ftp_user@$ftp_server
                ";
                    }
                
                    $contents = ftp_nlist($conn_id, ".");
                    var_dump($contents);
                
                    ftp_close($conn_id);  
                
                    die;
                

                输出

                Connected as $ftp_user@$ftp_server;
                

                boolean false
                

                为什么不列出文件?

                我可以用

                  file_exists("ftp//user:pass@host.com") 
                

                ...但是简单的部分不是我想要的,我什么都学不会

                ... but the easy part is not what im looking for, i would not learn anything

                推荐答案

                ftp_nlist() 发生错误时返回false.我猜你需要使用被动传输:

                ftp_nlist() returns false when an error occurs. I'm guessing you need to use passive transfer:

                // after ftp_login(...)
                ftp_pasv($conn_id, true);
                

                Generell,我建议使用像 ftp 这样的 CLI 工具或像 Filezilla 这样的 GUI 客户端来解决这个问题.日志/输出非常非常有用.

                Generell, I'd recommend troubleshooting this by using a a CLI tool like ftp or a GUI-client like Filezilla. The log/output is very, very helpful.

                HTH

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

                上一篇:从 PHP/GD 中的资源获取图像 mimetype? 下一篇:通过 PHP 表单进行 FTP 上传

                相关文章

                <tfoot id='dXVTv'></tfoot>

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

                  <legend id='dXVTv'><style id='dXVTv'><dir id='dXVTv'><q id='dXVTv'></q></dir></style></legend>

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

                    • <bdo id='dXVTv'></bdo><ul id='dXVTv'></ul>