wedz Posted May 25, 2012 Share Posted May 25, 2012 Hi all, I've been trying to get some help with some linux tty access issue in a PHP in different linux areas, but so far I have been unsuccessful to find a solution, so I thought maybe some PHP gurus here might know the problem.. So, I have infra-red module connected to usb, that has is seen as a tty port, and I can read/write data from/to it fine. Now I'm trying to run a PHP 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. I get complaint "error accessing".. I checked the executing user for Apache with 'whoami', and the user (www-data) has access to dialup group (in /etc/group): ... dialout:x:20:jlumme,www-data ... If I become user www-data (su www-data), I can read and write from the tty ok. The tty itself looks like this: >ls -l /dev/tty ... crw-rw---- 1 root dialout 166, 0 2012-05-03 19:10 ttyACM0 ... Any ideas why my application on Apache seems to always fail to 'access error' ? Edit: oh and if someone wants to get points to stackoverflow, I tried there before as well: http://stackoverflow.com/questions/10645370/reading-data-from-dev-tty-port-in-php-application-fails-to-error-reading/10664569 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/263101-failure-reading-data-from-devtty-port-in-php-application/ Share on other sites More sharing options...
kicken Posted May 25, 2012 Share Posted May 25, 2012 What is the exact error message you are getting? Make sure your error_reporting is set to E_ALL and that your not using the @ operator anywhere so you can see any warning PHP might throw. Quote Link to comment https://forums.phpfreaks.com/topic/263101-failure-reading-data-from-devtty-port-in-php-application/#findComment-1348526 Share on other sites More sharing options...
wedz Posted May 25, 2012 Author Share Posted May 25, 2012 Hi kicken, Thanks for your reply. I'll get the exact error message, as soon as I get back home and have a moment to sit down with the system.. I'm quite new to PHP - actually this is my first time to write something for it myself.. so I might have some issues even in some basic configurations.. Quote Link to comment https://forums.phpfreaks.com/topic/263101-failure-reading-data-from-devtty-port-in-php-application/#findComment-1348529 Share on other sites More sharing options...
wedz Posted May 25, 2012 Author Share Posted May 25, 2012 Hmm, I guess some user rights propagation thing happened... When I was modifying my php.ini config, I thought I might need to reload Apache, but to be on the safe side I just rebooted the whole linux, and now the reading from tty went fine! I have been going crazy with this for weeks now... Thanks for your time anyhow! Quote Link to comment https://forums.phpfreaks.com/topic/263101-failure-reading-data-from-devtty-port-in-php-application/#findComment-1348605 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.