lang/php

PHP7 event, libevent Installation

C/H 2018. 6. 6. 08:30

PECL event

#yum install libevent-devel -y
sudo apt-get install libevent-dev -y
sudo pecl channel-update pecl.php.net
sudo pecl install event
downloading event-2.3.0.tgz ...
.....
Include libevent OpenSSL support [yes] : no
.....

Build process completed successfully
Installing '/usr/lib/php/20170718/event.so'
install ok: channel://pecl.php.net/event-2.3.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=event.so" to php.ini

libevent 확장은 php7을 지원하지 않으며 php7 사용자는 event를 사용해한다. 
하지만 그 조차도 안된다면 아래 pecl-event-libevent.git 을 설치 해서 사용할 수 있다.

libevent Installation

# 사전설치
sudo apt-get install gcc make libevent-dev

# libevent 설치
git clone https://github.com/expressif/pecl-event-libevent.git
cd pecl-event-libevent
phpize
./configure
make && sudo make install

php.ini extention

#extension=event.so
#extension=libevent.so

# event.so, ubuntu
sudo vi /etc/php/7.2/mods-available/event.ini
cd /etc/php/7.2/cli/conf.d
sudo ln -s ../../mods-available/event.ini 20-event.ini

# libevent.so, ubunut
sudo vi /etc/php/7.2/mods-available/libevent.ini
cd /etc/php/7.2/cli/conf.d
sudo ln -s ../../mods-available/libevent.ini 20-libevent.ini

libevent.so, event.so /usr/lib/php/20160303/ Not Found Error

cd /usr/lib/php/20160303/
sudo ln -s ../20170718/libevent.so
sudo ln -s ../20170718/event.so


반응형