iluv8250 Posted July 30, 2009 Share Posted July 30, 2009 hi everyone! I want to execute some shell command on php. I using fedora core 9. I can execute simple command as ls -l or iptables -h but I can't execute commands as service iptables start or iptables -L :facewall:. I use user apache (default user) and I changed UID as root. What's problem? please reply soon. thks! Quote Link to comment https://forums.phpfreaks.com/topic/168101-how-to-execute-shell-command-on-php/ Share on other sites More sharing options...
trq Posted July 30, 2009 Share Posted July 30, 2009 iptables needs to be executed as root, simply joining the root group is not sufficient. You could give your apache user permission to execute iptables via sudo. Take a look in your /etc/sudoers file for examples. Quote Link to comment https://forums.phpfreaks.com/topic/168101-how-to-execute-shell-command-on-php/#findComment-886612 Share on other sites More sharing options...
iluv8250 Posted July 31, 2009 Author Share Posted July 31, 2009 iptables needs to be executed as root, simply joining the root group is not sufficient. You could give your apache user permission to execute iptables via sudo. Take a look in your /etc/sudoers file for examples. in /etc/sudoers file has line apache ALL=NOPASSWD: /sbin/iptables. what does it mean? thks! Quote Link to comment https://forums.phpfreaks.com/topic/168101-how-to-execute-shell-command-on-php/#findComment-887467 Share on other sites More sharing options...
iluv8250 Posted August 2, 2009 Author Share Posted August 2, 2009 pls help me!!! Quote Link to comment https://forums.phpfreaks.com/topic/168101-how-to-execute-shell-command-on-php/#findComment-888776 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.