KevinGriffioen
Posts: 3
Joined: Tue May 12, 2015 7:05 am
Location: Antwerp, Belgium

Permission Issue

Wed May 27, 2015 5:49 pm

Hi,

I'm literaly facing my last problem on this project I'm working on. If this gets out of the way, my project is done. So please help.

I programmed every code and it al works when I use "sudo python motor.py". As you probebly figure, it turn a motor on and off.

When I press a button on a html page I wrote, It opens the file, excecutes the code and stops at line 13.....

Then my server gives the error you see in the attachment:
http://1drv.ms/1LIw1CE

How can I solve this ? I would like to keep using rpi.GPIO instead of WiringPi op Pigpio
Last edited by KevinGriffioen on Wed May 27, 2015 5:59 pm, edited 1 time in total.

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: Permission Issue

Wed May 27, 2015 5:58 pm

Try to add the www-data user to the sudoers file for python:

Code: Select all

sudo visudo
Add at the end:

Code: Select all

www-data ALL=NOPASSWD: /usr/bin/python
Laurens

User avatar
DougieLawson
Posts: 39297
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Permission Issue

Wed May 27, 2015 7:27 pm

That is an enormous security hole that you've just opened.

Use pigpiod it is much better because it moves the stuff that needs root access to the pigpio daemon and the web server userid doesn't need any special permissions.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”