问题
Working with:
- Linux Debian
- Lighttpd Server
- PHP7.0
I want to launch some shell scripts pressing HTML buttons. All the files are placed in /var/www/html The rights are done by:
sudo chown www-data:www-data /var/www/
So, I wrote some code:
HTML test code (index.html):
<form action="openApp.php">
<input type="submit" value="Open Script">
</form>
PHP test code (openApp.php):
<?php
exec('nautilus');
header('Location: http://localhost/index.html?success=true');
?>
But no luck, nothing is working.
Also, my Lighttpd configuration file is like that:
server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_fastcgi", "mod_redirect", )
May be I am wrong with that piece of code. Do I need some Javascript to do the job ? May be the rights are wrong ?
Could you help me please ? I am stuck with that.
来源:https://stackoverflow.com/questions/59191195/html-button-launch-shell-script