I have script like
Code: Select all
#!/bin/sh
#
echo 1 > /sys/devices/virtual/gpio/gpio4/value
I want php file has a button when I press this button .. XX.sh run
I tried ( exec , shell_exec )
please help
Code: Select all
#!/bin/sh
#
echo 1 > /sys/devices/virtual/gpio/gpio4/value
Richard-TX wrote:use full pathnames in your php script
chmod your script to something like 755
Code: Select all
<?php
$output = shell_exec('sudo /var/www/XX.sh');
echo "<pre>".$output."</pre>";
?>