LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
LinkBack Search this Thread
Old 05-03-2012, 05:34 AM   #1
wedz
LQ Newbie
 
Registered: Jun 2008
Posts: 12

Rep: Reputation: 0
Question 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 05:35 AM. Reason: more information
 
Old 05-03-2012, 04:02 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
And what are the perms on the ports?
ls -l /dev/tty (or where ever they are in your distro)?
 
Old 05-05-2012, 06:46 AM   #3
wedz
LQ Newbie
 
Registered: Jun 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
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
 
Old 05-22-2012, 07:34 PM   #4
wedz
LQ Newbie
 
Registered: Jun 2008
Posts: 12

Original Poster
Rep: Reputation: 0
No ideas, anyone ?
 
  


Reply

Tags
access, illegal, php, serial port, ttyacm0


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"bad tty" & "file descriptor error" while building RPM on F13 gosssamer Linux - Software 7 12-28-2010 05:02 PM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-29-2004 11:18 PM
"Function not implemented" error in call to "sem_open()" Krishnendu8 Linux - Newbie 1 06-07-2003 02:52 AM
"Function not imlemented" error in call to "sem_open()" Krishnendu8 Linux - Networking 0 06-07-2003 02:19 AM


All times are GMT -5. The time now is 09:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration