title: suPHP execute PHP script as root
body: <p>I have created several websites. Now I need to perform <code>root</code> tasks. I created a webplatform and installed. <code>root</code> owns all scripts in <code>/var/private-www/</code> and they are chmodded (0777). In <code>/var/private-www/test.php</code> stands: <code>&lt;?php echo exec('whoami'); ?&gt;</code>. My <code>suPHP</code> config is this:</p>
  
  <pre><code> [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"
  </code></pre>
  
  <p>When I execute <code>test.php</code> in my webbrowser, it says: <code>www-data</code> :(. Not <code>root</code>... Even when I execute it in the command line. Besides, I did <code>a2enmod suphp</code> and <code>apachectl restart</code>, so I was thinking it would work. How can I fix this?</p>