Closed Sogl closed 9 years ago
Line 711 (I add var_dump after):
$body=$this->transport->readAll($length-16);
var_dump($length-16);
var_dump($body);
Result:
int(14)
NULL
Hi Sogl, as stated in the F.A.Q.. For Windows, you'll need the older windows compatible version, which does not use the socket extension. https://github.com/onlinecity/php-smpp/tree/windows-compatible
Ok, but if I test same code on Limux Ubuntu Server 14.04 I got another error:
Fatal error: Uncaught exception 'SocketTransportException' with message 'Could not connect to any of the specified hosts' in /var/www/sms/vendor/php-smpp/php-smpp/sockettransport.class.php:262 Stack trace: #0 /var/www/sms/sender.php(55): SocketTransport->open() #1 {main} thrown in /var/www/sms/vendor/php-smpp/php-smpp/sockettransport.class.php on line 262
For test I install PEAR ping. Code:
require_once "Net/Ping.php";
$ping = Net_Ping::factory();
if (PEAR::isError($ping)) {
echo $ping->getMessage();
} else {
$ping->setArgs(array('count' => 4));
var_dump($ping->ping('smpp.mcommunicator.ru'));
}
And ping works fine!
That ping works does not mean that a firewall does not block TCP communication. Try opening a telnet session to the specific host and port number.
Telnet to this host/port works fine, just tested.
($this->hosts)
contain valid host and IP.
Where can I see debug messages like that:
if ($this->debug) call_user_func($this->debugHandler, "Connecting to $ip:$port...");
Debug mode is ON.
'Could not connect to any of the specified hosts' is a clear indication of connection issues, so you need to work this out on your own.
Line 249 in sockettransport.class.php
causes the problem:
$r = @socket_connect($socket4, $ip, $port);
All variables are not empty, but $r
is NULL.
Found the same: https://github.com/onlinecity/php-smpp/issues/35
Dears, Could you solve it? I have the same problem.
Hi!
I'm trying to use send SMS example but it don't work.
After setting all parameters I see these errors:
What I'm doing wrong?