因为使用的GatewayWorker框架使用了swoole,但swoole依赖于event,所以必须安装下event扩展!
1. 最初使用brew install libevent安装了下,运行gatewayworker发现错误依然存在!
2. 考虑到是php里使用event,所以改用pecl去安装,先用pecl search event搜索了下,结果如下:
[zcm@7.2 47]$pecl search event
Retrieving data...0%
.Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
event 2.4.1 (stable) Provides interface to libevent library
libevent 0.1.0 (beta) Libevent - event notification
但是用pecl install libevent时,发现因为这个版本是beta版本,所以下载失败。。。。
改用pecl install event,安装过程中因为无法找到openssl的库路径而安装失败,因此改用先下载安装包,再自行解压安装
3. pecl download event
tar -zxvf event-2.4.1.tgz
cd event event-2.4.1
phpize
./configure --with-php-config=/usr/local/opt/php/bin/php-config --enable-event-debug=yes --enable-event-sockets=yes --with-event-libevent-dir=/usr --with-event-pthreads --with-event-extra --with-even