- Apr 14, 2002
- 7,701
- 0
- 0
I want to call a program from my Linux computer using php. I created this file test.php:
<? system("snortsnarf"); ?>
and it works as expected from the command line typing "php test.php". Now, the problem comes in when I try to run it from a web browser. The page loads without any errors, but the script snortsnarf does not execute as expected. The file snortsnarf is a shell script I created to execute Silicon Defense Snortsnarf program with the options I want. This file is located in /usr/sbin/ with the permissions set to 755. I have tried replacing the system call with exec, and same thing happens. I have also tried putting within the quotes the actual call to the snortsnarf.pl file from Silicon Defense with the options. Does anyone know what I can do to fix this? I have tried using "ping 192.168.1.1 -c 5" to test the system call, and that works. Can anyone help me?
<? system("snortsnarf"); ?>
and it works as expected from the command line typing "php test.php". Now, the problem comes in when I try to run it from a web browser. The page loads without any errors, but the script snortsnarf does not execute as expected. The file snortsnarf is a shell script I created to execute Silicon Defense Snortsnarf program with the options I want. This file is located in /usr/sbin/ with the permissions set to 755. I have tried replacing the system call with exec, and same thing happens. I have also tried putting within the quotes the actual call to the snortsnarf.pl file from Silicon Defense with the options. Does anyone know what I can do to fix this? I have tried using "ping 192.168.1.1 -c 5" to test the system call, and that works. Can anyone help me?