HugoPi
Posts: 2
Joined: Sun Feb 15, 2015 3:58 pm

PHP, serial connection error in browser

Mon Feb 16, 2015 7:09 pm

Hello everybody,
I need some help because for several days I have a problem with PHP and Midori.
My goal is to build a serial communication to an Arduino via a PHP page. For this I use the following class: https://github.com/Xowap/PHP-Serial
When I run the PHP script in the terminal the serial connection works. In the browser, it does not work. The error.log of Apache / Lighttpd (I have tried both without success) gives me this error: "FastCGI stderr: PHP Fatal error: No stty availible, unable to run in /var/www/PhpSerial.php. "
I just assumed it is a permission issue, so I added www-data to the group dialout. Unfortunately, without success. I have also tried to change the default user www-data in / etc/apache2/envvars to the user Pi
I have adapted the rights in this folder /var/www

Code: Select all

chown -R www-data-data.www *
And I have done this

Code: Select all

chmod 777 / dev / ttyACM0
Unfortunately, I still receive the error message ....
Please help
Best regards
Hugo

reibe
Posts: 1
Joined: Tue Mar 03, 2015 5:30 pm

Re: PHP, serial connection error in browser

Tue Mar 03, 2015 5:47 pm

Hi,
i have had the same problem with a Ubuntu-Linux-System, because i test my webserver on a fast system before i copy it to my raspberry.

Inside the file PhpSerial.php search for "if ($this->_exec("stty") === 0) {" (normally line 50) and change "stty" to "stty --version".

Then it works! But the user www-data should be in the group dialout.

Best regards.
Bernd

Return to “Beginners”