I have a python file on my raspberrypi that makes an led blink, which i made executable with chmod +x file.py so that in terminal i can run ./file.py and the led blinks. I then wrote a php file (in the same directory as file.py)
code
<html>
<head>
<title id = "my_title"> my page </title>
</head>
<body>
<button id="my-button"> Button </button>
</body>
</html>
I want to run file.py when i push the button, maybe with system ("./file.py");. But when i putt this directly in the code
<?php
system ("./file.py");
?>
it doesnt do anything except print on the site Number of arguments: 1 arguments. Argument List: ['./file.py'] (ls works as expected). How might i go about running file.py when Button is pushed, and why won't system run ./file.py. Thanks