php serial communication in linux

前端 未结 4 1932
时光说笑
时光说笑 2021-01-12 07:02

I have installed xampp in fedora 13.I am trying to communicate with microcontroller through serial port using php serial class. My code is example.php

inclu         


        
4条回答
  •  抹茶落季
    2021-01-12 07:20

    I did this once with Debian to control an Arduino board with a PHP script and initially ran into the same problem.

    In Debian, you need to add the Apache user to the dialout group in order to allow it to make serial connection requests. I would assume the same is true for Fedora.

    In Debian the command is:

    useradd -G dialout www-data
    

    However I believe Fedora names the Apache user as apache instead. I don't have a Fedora machine to test on, but I would assume the command you need to run is:

    useradd -G dialout apache
    

    You will then need to restart your xampp server.

    See the following for reference:

    http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/ http://fedoraproject.org/wiki/Administration_Guide_Draft/Apache#Apache_File_Security

    Neal

提交回复
热议问题