我创建了几个网站。现在我需要执行root
任务。我创建了一个网络平台并安装了。root
拥有其中的所有脚本,/var/private-www/
并且它们是 chmodded (0777)。在/var/private-www/test.php
看台上:<?php echo exec('whoami'); ?>
。我的suPHP
配置是这样的:
[global]
;Path to logfile
logfile=/var/log/suphp/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=root
;Path all scripts have to be in
docroot=/var/private-www
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true
;Send minor error messages to browser
errors_to_browser=false
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0077
; Minimum UID
min_uid=0
; Minimum GID
min_gid=0
[handlers]
;Handler for php-scripts
application/x-httpd-suphp="php:/usr/bin/php-cgi"
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"
当我test.php
在我的网络浏览器中执行时,它说:www-data
:(。不是root
......即使我在命令行中执行它。此外,我做了a2enmod suphp
and apachectl restart
,所以我认为它会起作用。我该如何解决这个问题?