php安装event扩展的问题
為什么80%的碼農都做不了架構師?>>> ??
event是libevent的OOP封裝,比libevent擴展提供了更完善的OOP結構和大量的內置可重用組件,libevent不支持php 7及后續版本,已經逐步被pecl舍棄,其最新版本只維護到2013年且長期處于beta狀態。
所以,建議優先使用event而不是libevent擴展。 廣義上的libevent是指libevent這個事件庫,但PHP中的一個擴展也稱為libevent, 實際使用時要注意加以區分。
event擴展依賴libevent2庫,安裝event時可能遇到以下錯誤: checking for include/event2/event.h... not found configure: error: Please reinstall the event library, or provide the installation prefix via --with-event-libevent-dir option ERROR: `/tmp/pear/temp/event/configure --with-php-config=/usr/local/php/bin/php-config --enable-event-debug=no --enable-event-sockets=yes --with-event-libevent-dir=/usr --with-event-pthreads=no --with-event-extra --with-event-openssl --with-openssl-dir=no' failed 提示沒有安裝libevent2軟件包:
嘗試安裝: yum install libevent2 提示:Error: libevent2-devel conflicts with libevent-devel-1.4.13-4.el6.x86_64 與舊版本沖突,卸載舊版本: yum remove libevent
然后再安裝libevent軟件包,成功 最后安裝event組件:
pecl install event 成功。
注意:一些php安裝中可能沒有pecl命令,這個命令集成在pear包中,編譯php時需要啟用pear包: 不要在confiure參數中添加:--without-pear
轉載于:https://my.oschina.net/zxu/blog/1575574
總結
以上是生活随笔為你收集整理的php安装event扩展的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 1、Hive原理及查询优化
- 下一篇: 丧尸大作!腾讯手游《黎明觉醒》上线:虚幻