linux对workerman的扩展和配置

1,event扩展安装错误--with-event-libevent-dir

/opt/appnode/appnode-php56/root/usr/bin/pecl install event --with-event-libevent-dir=/usr/share/doc/libevent-devel-1.4.13

上面方法失败

/opt/appnode/appnode-php56/root/usr/bin/pecl  install channel://pecl.php.net/libevent-0.1.0

 

安装失败,php7安装event,php5.3-5.6安装libevent

安装后配置php.d下面的sockets.ini注意注意

centos系统

yum install libevent-devel
pecl install channel://pecl.php.net/libevent-0.1.0 //提示libevent installation [autodetect]: 时按回车
echo extension=libevent.so > /etc/php.d/libevent.ini

注意这里的配置文件不是php.ini,是php.d目录下的sockets.ini或者20-sockets.ini

; Enable sockets extension module
extension=sockets.so
extension=/opt/appnode/appnode-php56/root/usr/lib64/php/modules/libevent.so

将 extension=socket.so 写在 extension=event.so 前面

extension=/usr/lib64/php/modules/libevent.so

如果需要更新pecl channel-update pecl.php.net

/opt/appnode/appnode-php56/root/usr/bin/pecl  channel-update pecl.php.net

 

1、如果出现如下报错 checking for include/event2/event.h... not found,请先尝试删除libevent-dev(el)库安并装libevent2-dev(el)。 centos系统:yum remove libevent-devel && yum install libevent2-devel debian/ubuntu系统:apt-get remove libevent-dev && apt-get install libevent2-dev

2、如果出现如下报错NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '.../event.so' - ..../event.so: undefined symbol: php_sockets_le_socket in Unknown on line 0。 请更改event.so 和socket.so的加载顺序,既在php.ini中将 extension=socket.so 写在 extension=event.so 前面,让socket扩展先加载。

posted @ 2019-07-16 16:34  blues-lee  阅读(1132)  评论(0编辑  收藏  举报