LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 05-03-2012, 06: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 06:35 AM. Reason: more information
 
Old 05-03-2012, 05:02 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
And what are the perms on the ports?
ls -l /dev/tty (or where ever they are in your distro)?
 
Old 05-05-2012, 07: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, 08: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



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 06:02 PM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 02:34 PM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-30-2004 12:18 AM
"Function not implemented" error in call to "sem_open()" Krishnendu8 Linux - Newbie 1 06-07-2003 03:52 AM
"Function not imlemented" error in call to "sem_open()" Krishnendu8 Linux - Networking 0 06-07-2003 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:25 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration