'PHP file not executing Python file from webserver
I'm currently working on a project with multiple raspberry's which are all controlled by a main panel on a webpage. The idea is that if I press a button on the webpage it runs a Python script on the pi which is connected to that certain button. It works fine, except for one pi.
I used the same code as the other pis but it won't work for some reason. Could anyone help me out?
PHP file:
<?php
system("python /home/pi/Desktop/controllers/slaap-all-off.py");
?>
JS code connected to the button calling the php file in the background:
$('#dosometing').on('click', function() {
$.ajax({
url : 'http://webserverip/dosomething.php'
}).done(function(data) {
console.log(data);
});
});
if I run the php file on the raspberry it self it will give a reaction, however if I open the file in a webpage it won't do anything.
I think it is somewhere in the permission settings of my pi.
Does someone have any ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
