I am having trouble getting a file to execute without typing sudo
before it. I think the problem is the libraries I used require you to be a superuser.
I am working on a program for the Raspberry Pi
and so far everything has worked great. The program takes a command line argument and outputs it to a separate 2x16 LCD. So if I type the following command as root or place sudo
in front of it the program functions as intended:./serialTest Hello World
.
What I am working on now is getting the value of a text box on a PHP
webpage and submitting it to the program as a command line argument using the exec()
function in PHP
The problem is that I am unable to execute it because unless I am root
I have tried exec("sudo ./serialTest" . $textBox);
but it still tells me Permission Denied
After further reading into the libraries I am using I cam across instructions on how to execute the serialOpen
function without using sudo
or being root
I have added the user pi
and www-data
to the dialout
group I have verified this with id pi
id www-data
. The program still says Permission denied
. Is there something I could look at further or am I doing something wrong? I have included the excerpt from the page that states how to run it without using sudo
or being root
You can use it without sudo if you add yourself into the dialout group. either edit /etc/group, or use the usermod command. (and logout/login again)
-Gordon