read from comport: windows vs. linux

From: Date: Tue, 05 Apr 2005 13:14:39 +0000
Subject: read from comport: windows vs. linux
Groups: php.general 
Request: Send a blank email to php-general+get-212256@lists.php.net to get a copy of this message
Hi there I´ve got a problem porting from windows to Linux, when I wanna read and write to the serial port. This works like a charm in windows: if (!$fp = fopen("COM1", 'w+b')) { echo "\nError! Could not open COMport - Got a terminal open?\n"; exit; } The program continues, but breaks in linux: if (!$fp = fopen("/dev/ttyS0", 'w+b')) { echo "\nError! Could not open COMport - Got a terminal open?\n"; exit; } I´ve checked and made sure that there´s a device on /dev/ttyS0 with minicom, where I´ve got no problem accessing the device. But I keep getting this error: Warning: fopen(/dev/ttyS0): failed to open stream: Permission denied in /var/www/html/s.php on line 85 Line 85 is the fopen line. Permissions are: crw-rw-rw- 1 root uucp 4, 64 Apr 5 13:38 /dev/ttyS0 having apache be the groupowner doesn´t change anything Now, what have I missed? -- Med venlig hilsen / best regards ComX Networks A/S Kim Madsen Systemudvikler/systemdeveloper

« previous php.general (#212256) next »