I am creating a php script that connects to a 3G modem connected through a serial connection on COM5.
I get the following error, and I believe that this is because php does not have access to the r / w COM interface:
Warning: fopen (COM5 :) [function.fopen]: could not open the stream: there is no such file or directory in C: \ xampp \ htdocs \ SMStest \ test2.php on line 9
$fp = fopen ("COM5:", "w+");
if (!$fp) {
echo "Uh-oh. Port not opened.";
} else {
$e = chr(27);
$string = $e . "A" . $e . "H300";
$string .= $e . "V100" . $e . "XL1SATO";
$string .= $e . "Q1" . $e . "Z";
echo $string;
fputs ($fp, $string );
fclose ($fp);
}
Luben source
share