I'm trying to run a shell script from a php frontend
heres the shell file (run.sh chmod to 777)
#!/bin/bash
wget -O index.html http://markets.usatoday.com/custom/usatoday-com/html-mktscreener.asp
python hw7-9.py index.html
echo "done";
Heres the php front end
<?php
$output = shell_exec("run.sh");
echo "<pre>$output</pre>";
?>
But it php page doesn't return anything except
<pre></pre>
Have you tried doing error_reporting(-1);
at the top of your PHP script. Likely shell_exec
is disabled on your server.
Would you try $output = shell_exec("sh run.sh");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With