I would like to execute a program using PHP, a piece of code that will use an RF transmitter to turn on my lamp.
This is achieved from the command line:
action 63 A on
This is just a C program that someone wrote to manage GPIO contacts on my raspberry pi. So i do index.php
<?php
exec('action 63 A off');
?>
He does nothing until:
<?php
echo exec('action');
?>
Gives me the default text output of the program (explanation of the parameters used). This tells me PHP is running, the program is on, it can be executed. But my lamp does not turn on. Alternatively, by typing at the command prompt:
php index.php
/ , ! ( )
Nginx ( http) ? , , .
:
<?php
system('action 63 A off');
?>
, shell_exec
?