I'm trying to run a .sh script in php.
Here's the sh code
php fetchdrive.php
When I run the .sh script by double clicking, it works fine, and displays the variables I've returned (an array).
I'm using wampserver to run php. Multiple php files work properly, unfortunately this one can only be run command line, so I figure why not call the command via sh in my index.php file. When I try <?php echo exec('sh C:/wamp64/www/run.sh'); ?>
in my index.php file, it doesn't work. I know this because at the bottom of the php file I'm trying to execute it has alert("Hello");
Infact I don't think it's running the command at all when I try to use echo exec. All of this is because I'm trying to run a command "php fetchdrive.php" without having to manually type it in to terminal, since when I start running this server I won't have to re-run the command every time.
Any ideas?
Edit: Here's the script tag for the alert
<script type="text/javascript"> alert("Hello!"); </script>
It works on my other php files.
tl;dr I'm just trying to run a php terminal command within a website.