当前位置:首页 > php > 正文内容

如何解决php中exec()不返回输出的问题

zhangsir3年前 (2023-03-20)php250

不返回结果大概率是报错了。

我们可以通过在命令中附加 2>& 1 来将标准错误重定向到标准输出,这样问题就可以得到解决了,例如:

 exec('some_command --option 2>& 1',$ output,$ ret);


zhangsir版权f2防采集https://mianka.xyz

扫描二维码推送至手机访问。

版权声明:本文由zhangsir or zhangmaam发布,如需转载请注明出处。

本文链接:https://mianka.xyz/post/135.html

标签: phpexec
分享给朋友:

“如何解决php中exec()不返回输出的问题” 的相关文章

php7.4 安装zip扩展包

使用宝塔环境安装php7.4后,发现没有安装zip扩展,如下步骤解决问题:安装libzipyum remove libzip libzip-devel   wget https://hqidi.com/big/libzip-1.2.0.tar.g...

php 实现返回上一页

php实现返回上一页的功能的3种有效方法header(location:你的上一页的路径);   //   注意这个函数前不能有输出     header(location:.getenv(&quo...

think PHP返回上一页的办法!

think PHP返回上一页的办法!输入如下代码即可返回上一页return redirect($_SERVER["HTTP_REFERER"]);...

thinkphp 使用Filesystem类提示未找到Filesystem类

这是因为thinkphp官方升级了thinkphp版本的原因,只需要更新Filesystem类就行了更新命令行如下:composer require topthink/think-filesystem 1.0.1...

thinkphp6使用swoole步骤实例

一,给PHP软件下载swoole插件二,使用thinkphp6的自定义指令功能php think make:command Tcp tcp三,修改Tcp.php文件(位于:app\command\Tcp)<?php namespace app...

thinkphp6内置上传类的基本使用

thinkphp6内置上传类的基本使用

一,使用thinkphp6内置上传类上传文件//上传接口 public function filef() {     //获取上传文件     $file = reques...