How install libevent extension in Apache2

时间:2018-05-14 17:40:17

标签: php apache module libevent apache-modules

I try to install libevent in the php of my Apache2.4 in Ubuntu 16.04 but I can't do it.

I have this snippet of code for know if the library is detected in a test page on my apache server :

$test = event_base_new();

It says to me

Call to undefined function event_base_new()

I miss some informations like I don't know if a library is considered a mod (I think no) but i found no documentation about libraries in the Apache2 doc.

I compiled the source libevent-2.1.8-stable from the official website and add the line in my php.ini (php/apache2) :

extension=/usr/local/libevent.so 

I restarted my Apache2 but that doesn't work.

1 个答案:

答案 0 :(得分:1)

libevent扩展名不随PHP一起发布。它与event扩展名分开,也与libevent C库分开(但相关),与the Apache event MPM完全无关。

如果您要安装PHP libevent扩展程序,则需要从PECL安装它。但是,该扩展程序与PHP 7不兼容,并且自2013年以来一直没有更新,因此您可能不想要它。