[英]php exec don't run php script when i hit through browser OS X
If i run following script through Mac OS terminal it php command run successfully 如果我通过Mac OS终端运行以下脚本,则php命令成功运行
function run_backend_script($params = array())
{
$cmd = '/usr/bin/php -v ';
var_dump(shell_exec($cmd));
}
run_backend_script();
but when i hit through browser script there is no any output; 但是当我浏览浏览器脚本时,没有任何输出; command don't execute.
命令不执行。
Note:- I had installed XAMPP on MacOSX 注意:-我已经在MacOSX上安装了XAMPP
Might be related to the php.ini file in the XAMPP installation. 可能与XAMPP安装中的php.ini文件有关。 Check if you are allowed to execute commands on it.
检查是否允许在其上执行命令。
Try another command, like ls
. 尝试另一个命令,例如
ls
。 If it works, check the user permission on the /usr/bin/php
binary. 如果可行,请检查
/usr/bin/php
二进制文件上的用户权限。 The apache
or www
user must be able to execute it. apache
或www
用户必须能够执行它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.