1. <legend id='KOEDy'><style id='KOEDy'><dir id='KOEDy'><q id='KOEDy'></q></dir></style></legend>
    2. <tfoot id='KOEDy'></tfoot>

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

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

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

        shell_exec() 在“ls"上返回 null

        shell_exec() returning null on quot;lsquot;(shell_exec() 在“ls上返回 null)
          <bdo id='YIgST'></bdo><ul id='YIgST'></ul>
            <tbody id='YIgST'></tbody>

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

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

                <i id='YIgST'><tr id='YIgST'><dt id='YIgST'><q id='YIgST'><span id='YIgST'><b id='YIgST'><form id='YIgST'><ins id='YIgST'></ins><ul id='YIgST'></ul><sub id='YIgST'></sub></form><legend id='YIgST'></legend><bdo id='YIgST'><pre id='YIgST'><center id='YIgST'></center></pre></bdo></b><th id='YIgST'></th></span></q></dt></tr></i><div id='YIgST'><tfoot id='YIgST'></tfoot><dl id='YIgST'><fieldset id='YIgST'></fieldset></dl></div>
                • <tfoot id='YIgST'></tfoot>
                • 本文介绍了shell_exec() 在“ls"上返回 null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  所以我有这段代码,我只是想在另一个目录中列出保存列表,其中 php 脚本位于 xampp 文件夹中,并且保存到此路径 /root/files/saves:

                  So I have this code and I'm only trying to make a list of the saves in another directory where the php scrip is in xampp folder and the saves are to this path /root/files/saves:

                  <html>
                  <body>
                  <?php
                  $output = shell_exec('ls /root/files/saves');
                  echo "<pre>$output</pre>";
                  ?>
                  </body>
                  </html>
                  

                  我不知道为什么我不能让它在 var_dump 上运行它似乎输出为空我真的很困惑它应该工作或者我完全错了我需要一些帮助.

                  I don't know why I can't get it working on a var_dump it seems output is null I'm really confuse it should work or I just it all wrong I need some help.

                  推荐答案

                  2>&1 添加到您的 shell 命令的末尾以使 STDERR 也返回作为 STDOUT.

                  Add 2>&1 to the end of your shell command to have STDERR returned as well as STDOUT.

                  $output = shell_exec("ls /root/files/saves 2>&1");
                  

                  另外,如果运行 PHP 的用户没有足够的权限查看 /root/ 中的输出,上述代码将返回 Permission denied 错误消息.

                  Also, if the user running PHP doesn't have sufficient permissions to view the output in /root/, the above code will return a Permission denied error message.

                  来源:http://php.net/manual/en/function.shell-exec.php#28994

                  这篇关于shell_exec() 在“ls"上返回 null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

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

                    <tbody id='U3Znx'></tbody>

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

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

                          1. <tfoot id='U3Znx'></tfoot>