【问题标题】:Shell Exec disabled外壳执行已禁用
【发布时间】:2014-07-14 17:50:41
【问题描述】:

我的服务器上的 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。谢谢!

【问题讨论】:

    标签: php apache shell shell-exec suhosin


    【解决方案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
    

    【讨论】:

      【解决方案2】:

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

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

      如果您找不到您的 VHOST conf 文件,请尝试 Zpanel -> Admin -> Module Admin -> 点击“Apache Config” 然后找到“Apache VHOST Conf”路径。

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

      【讨论】:

        【解决方案3】:

        首先你需要找到 httpd.conf 文件

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

        然后一个一个打开文件,搜索shell_exec词或黑名单词

        例子

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

        按 ctrl+w 并输入 suhosin.executor.func.blacklist 并回车 从此行中删除 shell_exec 并保存文件,保存文件后重新启动你的 apache

        # service httpd restart

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-12-04
          • 1970-01-01
          • 2018-08-31
          • 1970-01-01
          • 2013-08-16
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多