How to establish connection between Amazon MQ and phpMQTT

I am working on phpMQTT library. I am using the broker services of Amazon MQ. Now i am trying to connect with broker using php. For that i am using phpMQTT library.

<?php
require("phpMQTT.php");
$server = "";     
$port = 8883;                    
$username = "";                  
$password = "";                 
$client_id = "phpMQTT-publisher"; 
$mqtt = new phpMQTT($server, $port, $client_id);
if ($mqtt->connect(true, NULL, $username, $password)) {
echo "connected";
} else {
echo "Time out!\n";
}
?>

When i run my code it always keept on giving error

Notice: Uninitialized string offset: 0 in C:\xampp\htdocs\phpMQTT\phpMQTT.php on line 155

Notice: Uninitialized string offset: 0 in C:\xampp\htdocs\phpMQTT\phpMQTT.php on line 159

Notice: Uninitialized string offset: 3 in C:\xampp\htdocs\phpMQTT\phpMQTT.php on line 159
Time out!
Sponsor our Newsletter | Privacy Policy | Terms of Service