title: No access to /dev/mem. Try running as root on Raspberry Pi
body: <p>I am a Noob with the raspberry pi. I have it all setup and I am trying to run a file via the browser using <code>shell_exec</code>.</p>
  
  <p>Here is the content of the python file:</p>
  
  <pre><code>#! /usr/bin/python
  
  import time
  import RPi.GPIO as GPIO
  
  PIN_17 = 17 # Define LED colour and their GPIO pin
  GPIO.setmode(GPIO.BCM)
  
  GPIO.setup(PIN_17, GPIO.OUT) # Setup GPIO pin
  
  GPIO.output(PIN_17, True)  #Turn on
  time.sleep (1)               #Wait
  GPIO.output(PIN_17, False) #Turn off
  
  GPIO.cleanup() #Useful to clear the board
  </code></pre>
  
  <p>I have the file in the directory <code>/home/pi/</code> called <code>trigger_pin.py</code></p>
  
  <p>I am trying to run the file through the browser using the PHP command below in <code>remote.php</code>:</p>
  
  <pre><code>&lt;?php
  $output = shell_exec("cd /home/pi/ &amp;&amp; ./trigger_pin.py 2&gt;&amp;1"); //run command
  echo "$output"; //output from command
  ?&gt;
  </code></pre>
  
  <p>The output I am getting is:</p>
  
  <blockquote>
    <p>Traceback (most recent call last): File "./trigger_pin.py", line 9, in GPIO.setup(PIN_17, GPIO.OUT) # Setup GPIO pin RuntimeError: No access to /dev/mem. Try running as root!</p>
  </blockquote>