I want to turn an LED on and off through a website (index.php) which is located in "/var/www/html"
the two scripts are located in "/var/www/html/wspace/Server/"
. Both scripts work perfectly fine when I execute them with ssh but I am not able to execute them through my php file.
In my index.php I wrote the following code for on-/off.py:
exec("/usr/bin/python3.5 /wspace/Server/on.py");
(I located the python installation with which python3.5
. The answer was /usr/bin/python3.5
.)
I have no idea what is wrong. Is it he command itself or do I have to change sth. in apache? What has to be changed that it works?
As further information the owner and permissions of the files:
index.php pi:pi 777
on.py pi:pi 777
off.py pi:pi 777