title: How to run PHP exec() as root?
body: <p>I'm trying to build a firewall manager in PHP, but when I execute, <code>&lt;?php exec('iptables -L'); ?&gt;</code>, the result array is empty.</p>
  
  <p>I have tried, <code>&lt;?php echo exec('whoami'); ?&gt;</code>, and the response is <code>www-data</code> (the user that Apache is using). What can I do to execute the exec function as root? (Preferably without changing the Apache user.)</p>