Server user permissions to execute shell script

Discussion in 'General Programming Discussion' started by SepiD, Apr 22, 2014.

  1. SepiD

    SepiD New Member

    Joined:
    Mar 10, 2014
    Messages:
    6
    Likes Received:
    0
    Hello, I am trying to run shell_exec("echo 1 > /sys/class/gpio/gpio3/value"). But it doesn't work and i think it's because of permissions, how do i set them without hurting security of the server?
     
  2. SepiD

    SepiD New Member

    Joined:
    Mar 10, 2014
    Messages:
    6
    Likes Received:
    0
    I think i finally thought of a way, but then i have to go on each folder like /sys/class/gpio/gpio9 and type in "chmod -R www-data ." and i need this for quite some pins so i feel really stupid switching folders and typing the same thing... if i dont go on the specific folder it doesn't cover all subfiles, it's really weird.

    Could someone suggest a way to do it with proper recursion so i don't have to switch folders?
    Also it would be nice if someone approved if that's a safe way.
     

Share This Page