【发布时间】:2024-11-07 18:10:01
【问题描述】:
我的服务器上有 this 文件来控制我的飞利浦 Hue 灯。
从我运行 php huecli.php -i IP -k KEY ... 的 shell 中,它会输出正确的结果,但是当我将以下内容作为 PHP 脚本运行时,它会失败(超时)
$output = shell_exec('php huecli.php ...');
echo "<pre>$output</pre>";
当我停止运行脚本时,我看到很多输出如下所示:
X-Powered-By:PHP/5.5.30
内容类型:文本/html
【问题讨论】:
-
您是否尝试过使用 php.ini 的完整路径。 IE。在执行语句中使用
/usr/bin/php或您安装它的任何位置? -
是的,我尝试过使用完整路径
-
服务器错误日志是怎么说的?
-
“失败”究竟是什么意思?
-
超时。我发现问题是因为我没有使用
php-cli
标签: php shell philips-hue