Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-03-2012, 06:34 AM
|
#1
|
LQ Newbie
Registered: Jun 2008
Posts: 12
Rep:
|
php "system"-call to access tty port, "error accessing"
I have IR module in connected to a tty port, and I'm trying to run an application that would read data from that port, but for some reason my PHP script on Apache can't seem to read the serial port.
The user (www-data) has access to dialup group (in /etc/group), and if I switch over to www-data user, I am able to successfully run the program from the same folder where it resides (same folder with PHP script).
I checked the user who runs the PHP script by system call from PHP to 'whoami' and print it on screen, this is correct, right ?
I'm out of ideas, why Apache can't seem to access the port.
The program starts ok, and I get some proper output, but once trying to access the serial port, something goes awry..
Thanks for all the hints!
Last edited by wedz; 05-03-2012 at 06:35 AM.
Reason: more information
|
|
|
05-03-2012, 05:02 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
And what are the perms on the ports?
ls -l /dev/tty (or where ever they are in your distro)?
|
|
|
05-05-2012, 07:46 AM
|
#3
|
LQ Newbie
Registered: Jun 2008
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by Tinkster
And what are the perms on the ports?
ls -l /dev/tty (or where ever they are in your distro)?
|
Code:
crw-rw---- 1 root dialout 166, 0 2012-05-03 19:10 ttyACM0
I'm running ubuntu (on arm, but I guess that doesnt matter).
To /etc/groups I have added:
Code:
...
dialout:x:20:jlumme,www-data
...
The thing of it is, that I have changed to the www-data user, that apache/php uses, and I am able to read from that port as him
|
|
|
05-22-2012, 08:34 PM
|
#4
|
LQ Newbie
Registered: Jun 2008
Posts: 12
Original Poster
Rep:
|
No ideas, anyone ?
|
|
|
All times are GMT -5. The time now is 03:25 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|