I have a simple php script that passes a couple variables to and runs a python script with the shell_exec command. When I run this php script from the shell it works just fine. However, when I run the php script from the browser, it causes the server to crash. I've tried this with both exec and shell_exec php functions. Why would it matter whether I run the script form the shell or the browser?
For the record, I can run other commands from the browser successfully, such as "tar -xcpvf path.tar.gz"
Here is the php script that has trouble from the browser:
<?php
$inputs = array(
'location' => "Los Angeles",
'date' => '11/01/2012',
);
$cmd = 'python simple.py '.$inputs['location'].' '.$inputs['date'];
$results = shell_exec($cmd);
echo $results;
?>
Any help will be much appreciated. Thanks!