JimMace Posted February 21, 2007 Share Posted February 21, 2007 I have a command line application that runs a wildland fire simulation that I tried to execute from a PHP page. I have successfully been able to accomplish this from my laptop running fedora 5/PHP 5/Apache 2.2.2. I tried to copy this over to a similar installation on a lab server, in my office, but I was getting some permissions errors. I moved all of my configuration files to my html directory in Apache thinking that the problem was that Apache was trying to execute the application and it did not have sufficient permissions in the original directory. I tried to run the page again, but, this time I get a return status of 0, which is supposed to mean success, but the application never runs. I verified this by looking at my running processes and then application was not there. I am using the exec () method passing in the following string "farsite4 /var/www/html/farsite/ashley/Input/ashley_cl_settings.txt 2>&1". Now, if I run this string in my shell as root it works just fine and runs the simulation. I have also ran the chmod command on my farsite directory recursively with the value of 0777, but still no dice. Can someone please please throw me a bone. I am new to Linux and Apache, so please be kind... :-) Link to comment https://forums.phpfreaks.com/topic/39420-executing-shell-command/ Share on other sites More sharing options...
tom100 Posted February 21, 2007 Share Posted February 21, 2007 Can you make the result of your program return 1 if it's executed? That will help to start. Also, try using shell_exec and see if that helps or produces any errors or warnings. Link to comment https://forums.phpfreaks.com/topic/39420-executing-shell-command/#findComment-190200 Share on other sites More sharing options...
effigy Posted February 21, 2007 Share Posted February 21, 2007 What does this show you after replacing command? <pre> <?php passthru('command 2>&1', $var); echo '<b>Returned:</b> ', $var; ?> </pre> The problem could be that farsite4 is not in your path; try specifying the full path. Link to comment https://forums.phpfreaks.com/topic/39420-executing-shell-command/#findComment-190203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.