Re: simple php file tried to log in user to xmpp server-openfire failed--- new beginner

557 views
Skip to first unread message

Abhinav Singh

unread,
Dec 28, 2012, 2:21:00 AM12/28/12
to ja...@googlegroups.com
Hi Yanbin,

Yes there is a problem with your script. I see you do the necessary bootstrapping work (i.e. initialize jaxl instance, add callbacks), but you never start the event loop (i.e. you don't call $client->start();). Kindly check echo_bot.php and extend that for your use case.

--
Abhinav

On Friday, December 21, 2012 11:42:49 AM UTC+5:30, Yanbin Zhang wrote:
I am new beginner for jaxl :) and i wrote a very simple php file tried to login user to my xmpp server-openfire .  while it always report errors.
here is my environment and issues:
environment :
my test machine is linux ubuntu 12.04 and a xmpp server- openfire 3.7.1 was setup.
machine domain is test-jaxl
new user jid is alice@test-jaxl with password master was added at openfire database.
git clone jaxl source code folder to /home/test-jaxl/work/
then, goto jaxl source code folder
i write a very simple php file t
<?php
  require 'jaxl.php';
  $client = new JAXL(array (
       'jid' => 'alice@test-jaxl',
       'pass' => 'master',

));

  $client->add_cb('on_auth_success', function() {
      global $client;
      $client->set_status("available!");
      $client->get_roster();
     echo "login successful";




});
?

run test.php in command line : php test.php

error info is :
jaxl:219 - 2012-12-21 05:58:11 - strict mode enabled, adding exception handlers. Set 'strict'=>TRUE inside JAXL config to disable this
jaxl_exception:66 - 2012-12-21 05:58:11 - error handler called with 8, Undefined index: priv_dir, /home/test-jaxl/work/JAXL/jaxl.php, 146
jaxl:166 - 2012-12-21 05:58:11 - created pid file /home/test-jaxl/work/JAXL/.jaxl/run/jaxl_22577.pid
jaxl:211 - 2012-12-21 05:58:11 - cleaning up pid and unix sock files


something wrong ?  or some configuration file i need to set ?

btw, i try to run examples provided at examples folder e.g register_user.js , it also failed.
so, something may be configuration was missing before i run those test cases ?

thanks
Yanbin




Reply all
Reply to author
Forward
0 new messages