XMPPHP到Openfire [英] XMPPHP to Openfire

查看:88
本文介绍了XMPPHP到Openfire的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(这是我的第一个问题,请原谅)

(This is my first ever question so please excuse the noobness)

我有一个来自DigitalOcean的Ubuntu VPS,已经安装并正在运行Openfire.我正在尝试使用XMPPHP发送警报,但它不发送消息.

I have a Ubuntu VPS from DigitalOcean that I have Openfire installed and running. I'm trying to use XMPPHP to send alerts but it doesn't send the message.

我的代码:

include("../XMPPHP/XMPP.php");
$conn = new XMPPHP_XMPP('***.***.***.***', 5222, 'alert', 'password', 'xmpphp', '***.***.***.***', $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);
$conn->useEncryption(false);
$conn->connect();
$conn->processUntil('session_start');
$conn->presence("Ya, I'm online","available","aim.***.***.***.***");
$conn->message('user@***.***.***.***', "Whoah!");
$conn->disconnect();

错误:致命错误:在第86行的/var/www/html/XMPPHP/Log.php中,超过30秒的最大执行时间

Error: Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/XMPPHP/Log.php on line 86

更多详细的日志

1412738973 [INFO]: Connecting to tcp://***.***.***.***:5222 1412738973 [INFO]: Attempting Auth... 
1412738973 [INFO]: Trying DIGEST-MD5 (available : DIGEST-MD5,PLAIN) 1412738973 [INFO]: Auth success! 
1412738973 [INFO]: Bound to alert@***.***.***.***/xmpphp 1412738973 [INFO]: Session started Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/XMPPHP/Log.php on line 86

我有同样的代码可以在CentOS上安装的Openfire上正常工作,但是我当前的设置是在Ubuntu上.不确定是否会有所作为.我收到加密失败错误,因此已被禁用.

I have this same code working just fine on Openfire installed on CentOS at work but my current setup is on Ubuntu. Not sure if that would make a difference. I was getting encryption failed error so it's been disabled.

如果我没有在脚本中禁用它,则会出现此错误

If I don't disable it in the script, I get this error

[INFO]: Starting TLS encryption Warning: stream_socket_enable_crypto(): SSL: crypto enabling timeout in /var/www/html/XMPPHP/XMPP.php on line 525 Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/XMPPHP/XMLStream.php on line 466

到目前为止,我所知道的是它连接,认证然后开始会话,并且在存在时卡住了.我已经尝试了端口,服务器名称等的许多变体

All I know so far is that it connects, authenticates then starts the session and on presence it gets stuck. I have tried many variations of ports, server names etc

Ubuntu:12.04.5磅 PHP:5.3.10 开火:3.9.3

Ubuntu: 12.04.5 LTS PHP: 5.3.10 Openfire: 3.9.3

不确定要去哪里或做什么.请提供有关我可以如何解决此问题的建议.

Not sure where to go or what to do. Please advise as to what I can try to resolve this issue.

非常感谢.

推荐答案

$ conn->状态(是的,我在线",可用","目标. . .* .*****);

$conn->presence("Ya, I'm online","available","aim...*.*****");

我的服务器地址中不需要AIM部分.

I didn't need the AIM part in my server address.

现在一切正常.

这篇关于XMPPHP到Openfire的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆