I have a generate.php page
<?php
exec("./script $ip");
?>
I have verified that the the variable $ip is pulling from the URL correctly. When it redirects to this page it does not run the script. I have also tried to verify that the script works for the apache user and it does.
su -s /bin/sh apache -c "./script 1.1.1.1"
The code that sets the IP from my index.html page is this
<form action="generate.php">
<input type="text" name="ip" />
<input type="submit" />
</form>
When I enter the IP into the box and hit submit, it does take me to http://example.com/generate.php?ip=1.1.1.1
Is there something wrong with the way I am invoking the shell script? Any input will be greatly appreciated.
Thank you for all the input, turned out to be just selinux. Disabling selinux solved this issue. Since this is not a network connected system, selinux being disabled is not an issue.