in Debian 8, I'm trying to create a script I can put under /sbin
(which is in my $PATH
environment variable), so it can be run, the command is a simple echo of a few lines. I've created a bash script and made it executable, so I can run it from my terminals just like any other command, but I cannot run it from my PHP script, even though the $PATH
environment variable is the same in my terminal and in my script, (i've verified it).
The script will be called ifconfig
(and I know it's an obsolete program no longer around in debian 8, but I can't get around it for now, so I need a stub).
- When I run
ifconfig
from the terminal, I get all my successful output . - When I run
ifconfig
from the script, I get aFALSE
. - When I run a
which ifconfig
, the terminal outputs/sbin/ifconfig
. - When I run a
which ifconfig
from a PHP script, it doesn't return any route.
How can I make this bash script work on PHP? shell_exec('ifconfig');
or how can I manuplate the particular output of shell_exec('ifconfig');
The script is running under apache-2.4
I'm posting this because I'm not sure this should be in Stack Overflow, Super User, or Server Fault.