I can't see why exec() doesn't run on RaspberryPi but it outputs 'something'. Can someone please help me?
<?php
echo exec('GPIO.Output 1 1');
echo('something');
?>
I can't see why exec() doesn't run on RaspberryPi but it outputs 'something'. Can someone please help me?
<?php
echo exec('GPIO.Output 1 1');
echo('something');
?>
exec() returns only last line of executed command's output. Use shell_exec() instead.
Alternatively you can make use of seconde exec() argument which like:
$output = array();
exec('GPIO.Output 1 1', $output); // $output is passed by reference
Now $output contains command's output with every line as a separate array element