php无法执行系统命令

php无法执行系统命令,php,shell,exec,Php,Shell,Exec,出于某种原因,以下php脚本在通过apache调用时不会返回结果。。。php.ini中是否有允许系统命令的系统安全设置 <div style="background:#000;color:#fff"> <?php $cmd = "/bin/date"; $output = system($cmd); printf("System Output: $output\n"); exec($cmd, $results); printf("Exec Out

出于某种原因,以下php脚本在通过apache调用时不会返回结果。。。php.ini中是否有允许系统命令的系统安全设置

<div style="background:#000;color:#fff">
<?php

   $cmd = "/bin/date";
   $output = system($cmd);
   printf("System Output: $output\n");
   exec($cmd, $results);
   printf("Exec Output: {$results[0]}\n");
   echo"<pre>";
   echo system('/bin/ls');
   echo"</pre>";
   ?>
   </div>

您的主机(或配置)可能正在限制system()或exec()命令。检查您的配置或联系您的主机

应该是空白的,在我的机器上工作


另外,检查SElinux和Suhoshin是否正确配置了plesk安全模式。。。在httpd中禁用。包括。。。叹息。。。喜欢当系统降落在你的膝上时

我已经检查了php.ini,disable_functions=为空。什么是不返回<代码>系统`或exec`或两者都有?两者都没有。。。。。另外,系统正在运行…:)您应该首先查看类似的问题(请参阅右侧的Realated列,顶部有一个搜索框)。这些命令“不起作用”的原因有很多(事实上它们起作用了,但它们并没有达到您的预期——但它们工作得很好!)。还要考虑如何调试问题(您的代码看起来已经开始调试了)。此外,请联系您的系统管理员,她/他也应该能够帮助您。并启用错误报告与PHP,有安全模式等。似乎安全模式是在。。。通过phpinfo.php。有人知道如何在plesk中关闭安全模式吗?在php.ini中,它表示安全模式关闭…伙计们,selinux被禁用。。。这是怎么发生的?在apache日志中也看到sh:/date:没有这样的文件或目录sh:/date:没有这样的文件或目录sh:/ls:没有这样的文件或目录
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-functions
disable_functions =