I'm trying to build a firewall manager in PHP, but when I execute, <?php exec('iptables -L'); ?>
, the result array is empty.
I have tried, <?php echo exec('whoami'); ?>
, and the response is www-data
(the user that Apache is using). What can I do to execute the exec function as root? (Preferably without changing the Apache user.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…