Control Beaglebone GPIO pin from web page.

I want to control GPIO pin of beaglebone from web page.

My ledon python code here…


import Adafruit_BBIO.GPIO as GPIO
from time import sleep

while True:
GPIO.output(outPin, GPIO.HIGH)
print(‘LED ON’)


Here is my php code…


<?php $result = 'nothing'; if (isset($_POST['set_off'])) { $result = 'turned off'; shell_exec("sudo python /var/www/html/"); } if (isset($_POST['set_on'])) { $result = 'turned on'; shell_exec("sudo python /var/www/html/"); } ?> <?php if (isset($result)) { ?>

Action: <?php echo $result ?>

<?php } ?>


I run code on web with But the LED doesn’t turn to high or low.

What are the settings on beaglebone to run the python file from php code.