I am trying to execute AT commands from PHP.
I tried exec() and shell_exec()
Please don't suggest third party SMS gateway my client doesn't want to disclose his private information and wants to send SMS from his own server.
I have a GSM modem attach to a serial port which I can access through "putty" like in fig
And I can enter AT commands to send SMS like in fig below.
I want to run those AT commands through PHP.
Hi I am sending sms using php class on windows 8 by this php code.
require "php_serial.class.php";
$serial = new phpSerial;
$serial->deviceSet("COM4");
$serial->confBaudRate(115200);
// Then we need to open it
$serial->deviceOpen();
// To write into
$serial->sendMessage("AT+CMGF=1\n\r");
$serial->sendMessage("AT+cmgs=\"+92234444444\"\n\r");
$serial->sendMessage("sms text\n\r");
$serial->sendMessage(chr(26));
//wait for modem to send message
sleep(7);
$read=$serial->readPort();
$serial->deviceClose();