出于某种原因,当通过apache调用时,以下php脚本不返回结果... 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>
答案 0 :(得分:1)
您的主机(或配置)可能限制system()或exec()命令。检查您的配置或联系您的主机
; 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 =
应为空白,适用于我的机器
http://sandbox.phpcode.eu/g/e47f7
另外,检查SElinux和Suhoshin是否配置正确
答案 1 :(得分:0)
plesk安全模式...在httpd.include中禁用...叹息...当系统降落在你的腿上时爱它