php 开启 exec,如何在php上启用shell_exec和exec?

  • Post author:
  • Post category:php


(在网上有一些提及,但没有一个解决方案有效.)

我希望能够从

PHP脚本中使用shell_exec和exec.

含义,使用:

exec(“echo hello world”); ?>

要么

shell_exec(“echo hello world”); ?>

php_admin_value suhosin.executor.func.blacklist =“shell_exec”

但当我查看配置文件,尝试重新启动网络服务器时,我得到:

28/07/14 17:18:26: Syntax error on line 1 of /etc/httpd/conf.d/serv1.conf:

28/07/14 17:18:26: php_admin_value takes two arguments, PHP Value Modifier (Admin)

并且服务器未重新启动.

任何想法如何启用exec和shell_exec?我无法追踪此错误的来源.

编辑:我不是机器上的根.我找不到一个php.ini文件,但有一个/etc/httpd/conf.d/php.conf文件,它没有disable_functions.

这里是:

#

# PHP is an HTML-embedded scripting language which attempts to make it

# easy for developers to write dynamically generated webpages.

#

LoadModule php5_module modules/libphp5.so

LoadModule php5_module modules/libphp5-zts.so

#

# Cause the PHP interpreter to handle files with a .php extension.

#

AddHandler php5-script .php

AddType text/html .php

#

# Add index.php to the list of files that will be served as directory

# indexes.

#

DirectoryIndex index.php

#

# Uncomment the following line to allow PHP to pretty-print .phps

# files as PHP source code:

#

#AddType application/x-httpd-php-source .phps