Shell Exec已禁用

时间:2014-07-14 17:50:42

标签: php apache shell shell-exec suhosin

我的服务器上的shell exec有点麻烦。 在完成一些教程后,我改变了我的php.ini:

safe_mode   Off

disable_functions   pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,    pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

suhosin.executor.func.blacklist passthru, show_source, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec

这是我的phpinfo(),并且没有对shell_exec命令的引用。我不知道这个suhosin.executor.func.blacklist来自哪里,因为它在我的/etc/php5/apache2/conf.d/suhosin.ini中被注释掉了。

我在Ubuntu 12.04下使用zpanel。谢谢!

3 个答案:

答案 0 :(得分:1)

在所有潜在的php.ini文件中搜索suhosin.executor.func.blacklist可能会有所帮助,例如

grep -r suhosin.executor.func.blacklist /etc/php5

该条目也可以在应用程序目录或父目录中的.htaccess中设置,例如。

grep -r suhosin.executor.func.blacklist /var/www/

phpinfo()列出了.ini文件的目录,例如:

Scan this dir for additional .ini files => /foo/bar
Additional .ini files parsed => /foo/bar/php.ini

答案 1 :(得分:1)

它来自您的Apache VHOST Conf文件。 通常位于

  

/etc/zpanel/configs/apache/httpd-vhosts.conf

如果找不到您的VHOST配置文件,请尝试 Zpanel - >管理员 - >模块管理员 - >点击" Apache Config" 然后找到" Apache VHOST Conf"路径。

然后将该文件打开到任何文本编辑器中,并为您的自定义虚拟主机删除该值。

答案 2 :(得分:0)

首先,您需要找到httpd.conf文件

# find / -type f -name "httpd.conf"

然后逐个打开文件并搜索shell_exec word或blacklist word

实施例

# nano /etc/usrname/configs/apache/httpd-vhosts.conf

按ctrl + w并键入suhosin.executor.func.blacklist并按Enter键 从此行中删除shell_exec并保存文件,保存文件后重启你的apache,如

# service httpd restart

相关问题