C program embedded in PHP to read the serial port

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poisonvm
    New Member
    • Apr 2009
    • 6

    C program embedded in PHP to read the serial port

    I wrote a C program that is successfully able to read and write from the serial port.
    When the program is run in shell or terminal on linux it can read and write data to the micro controller.
    However when the program is embedded in PHP <?php echo exec("./send toserial.out"); ?> it is unable to send information to the micro controller.
    I have tried other programs embedded in PHP, like a C program that can read and write to a file and that works just fine.

    I would really appreciate any help on this matter. Thank you
  • poisonvm
    New Member
    • Apr 2009
    • 6

    #2
    Hello guys, i figured out the solution to this, and i have seen a couple of forums with this problem.
    My solution was to do this chmod 777 /dev/ttyUSB0.
    I believe this would not be secure but it works.
    Cheers

    Comment

    Working...