Open COM port in php

I have a 3G 3G modem Huawei E1550 and Windows XP. I want to send sms with this trhow php modem.

I use this function to open the modem's COM port:

$fp = fopen ("COM3:", "wb+");
if (!$fp) {
    echo "Not open";
} else {
    echo "Open";
}

And every time I get an error:

Warning: fopen (COM3 :) [function.fopen]: could not open the stream: invalid argument in D: \ Apache \ htdocs \ z91.ru \ audio \ test.php on line 3

+3
source share
1 answer

You can also try removing the colon next to COMn to make it work.

exec("mode COM3 BAUD=9600 PARITY=N data=8 stop=1 xon=off");

$fp = fopen ("COM3", "w");
if (!$fp) {
   echo "Not open";
} else {
   echo "Open";
}
+4
source

All Articles