Php example using XMPPPHp or JAXL to connect Google Cloud connection server

1.3k views Asked by At

I am trying to make CCS server for the google cloud downstream and upstream messaging. I made a server using Java, it was working well before I wanted to shift it to php for my convenience.

I found out two library which is XMPPPHP and JAXL for XMPP connection.

I am trying to use JAXL first using the below code with SetTimeOut of php environment to more than 2 minutes.

  <?php
 include_once 'jaxl.php';
 $client = new JAXL(array(
 'jid'=>'<my_sender_ID>@gcm.googleapis.com',
 'pass'=>'my_API_key',
 'auth_type'=>'PLAIN',
 'host' => 'gcm.googleapis.com',
 'port' => '5235',
 'force_tls' => true
)); 
$client->start();
echo "done";
?>

Studied the issue in the below url so changed the configuration too.

Link-1

Now I am getting:

Fatal error: Maximum execution time of 60 seconds exceeded in /var/www/vhosts/hostname/ccs-server/jaxl/core/jaxl_logger.php on line 51

When I tried my hands on XMPPPHP , I got the below link

Link-2

And got the same error as connecting to tcp://gcm.googleapis.com failed.

I am so worried if I could I transfer the server from Java or not.

0

There are 0 answers