Jump to content

Adjusting iptables useing exec() or system()


Recommended Posts

:) heya guys, ive hit a wall, thought id ask for help and here i am.

My problem is that im trying to update my iptables firewall useing a command that works in a terminal but not written into a page useing the system() or exec() commands.  i am useing apache ID'd as apache useing sudo NOPASSWD: ALL option opposed to running apache as root and having to recompile the source with the special option (which i cant get to work, but thats for another thread).

my script is a one liner.

<?php
system('/usr/bin/sudo /sbin/iptables -I INPUT 1 -s 1.1.1.1/32 -d 192.168.156.51 -p all -j ACCEPT');
?>

This is all thats stopping me from finishing this site module,

Thanks in advance

8)

Link to comment
https://forums.phpfreaks.com/topic/64610-adjusting-iptables-useing-exec-or-system/
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.