Can I read/write to the Serial Port, Comm1 or Comm2 using PHP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GG

    Can I read/write to the Serial Port, Comm1 or Comm2 using PHP?

    I don't know if this can be done. Can PHP be used to read/write to the
    serial port on a PC? Any replies related to Linux or Windows are
    welcome.

    Ultimately, I would like to be able to send a character string to the
    serial port when a button is clicked on a PHP driven website.

    Any thoughts anyone?

  • Urs Weder

    #2
    Re: Can I read/write to the Serial Port, Comm1 or Comm2 using PHP?

    GG wrote:[color=blue]
    > I don't know if this can be done. Can PHP be used to read/write to the
    > serial port on a PC? Any replies related to Linux or Windows are
    > welcome.
    >
    > Ultimately, I would like to be able to send a character string to the
    > serial port when a button is clicked on a PHP driven website.
    >
    > Any thoughts anyone?
    >[/color]
    My first thought is http://www.php.net/manual/en/ref.dio.php

    Greetings, Urs

    Comment

    • Chung Leong

      #3
      Re: Can I read/write to the Serial Port, Comm1 or Comm2 using PHP?

      On Windows, try fopen("com1", "wb") and write to the handle returned.

      Comment

      • GG

        #4
        Re: Can I read/write to the Serial Port, Comm1 or Comm2 using PHP?

        I was hoping for a cross platform solution but both yours and Urs' do
        not give me enough information to proceed.

        Does anyone else have any suggestions and can provide me with more
        detail?
        Thanks.

        Comment

        Working...