MeepoPS 基本使用 和 常见问题
作者:
秒速五厘米
截止到2018-07-25官方仍不支持该扩展
安装参考文档:https://github.com/expressif/pecl-event-libevent
前期准备
sudo apt-get install php7.0-dev gcc make libevent-dev // 存在则不进行安装
编译
# git clone https://github.com/expressif/pecl-event-libevent.git # cd pecl-event-libevent # phpize #./configure // 可能需要指定php-congig命令的路劲 --with-php-config # make && sudo make install # php.ini文件中,新增一行:extension=libevent.so 重启php-fpm # service php-fpm restart
错误一
# sudo php demo-telnet.php start 提示错误: HP Fatal error: Redefinition of parameter $_null in /data/www/MeepoPS/MeepoPS/Core/ Event/Libevent.php on line 155 [INFO][2017-06-14 16:29:38][8889]MeepoPS check shutdown reason [ERROR][2017-06-14 16:29:38][8889]stream_socket_serverMeepoPS unexpectedly quits. last error: {"type":64,"message":"Redefinition of parameter $_null","file":"/data/www/MeepoPS /MeepoPS/Core/Event/Libevent.php","line":155} [ERROR][2017-06-14 16:29:38][8888]MeepoPS instance(MeepoPS-Telnet:8889) exit. Status: 65280 PHP Fatal error: Redefinition of parameter $_null in /data/www/MeepoPS/MeepoPS/Core/Event/Libevent.php on line 155 解决方法: MeepoPS/Core/Event/Libevent.php 155行, public function timerCallback($_null1, $_null2, $timerId)的前两个参数原本都是$_null, 改成一个$_null1, 一个$_null2
错误二
错误事件:telnet ip:19910 提示:PHP Fatal error: Cannot unset $this in /home/ubuntu/MeepoPS/MeepoPS/Core /TransportProtocol/Tcp.php on line 353 解决方法: MeepoPS/Core/TransportProtocol/Tcp.php 353行,注释掉unset($this);