I want to run a php script on a button click in html. I've looked at a lot of the posts here, but they don't seem to work. As of now, I'm trying the solution here, but it doesn't work. I have no idea what's causing the trouble, but I know that it isn't the php file. Any help is appreciated.
php script:
<?php
shell_exec("/var/www/html/Camera/CameraScript.sh");
header('Location: /Camera/Camera.html?success=true');
?>
html code:
<form action="Script.php">
<input type="submit" value="Open Script">
</form>
Shell Script:
#!/bin/bash
raspistill --output /var/www/html/Camera/Photos/Image.jpg