Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrian-green/0ef69a78cb42d32cadff5efec06a4364 to your computer and use it in GitHub Desktop.
Save adrian-green/0ef69a78cb42d32cadff5efec06a4364 to your computer and use it in GitHub Desktop.
Installing ev, event and libevent for PHP 7.4 on Ubuntu 20.04
cd /usr/src/
git clone https://github.com/expressif/pecl-event-libevent.git
cd pecl-event-libevent
phpize
./configure
make && sudo make install
sudo apt update
sudo apt install php7.4-dev libevent-dev
# Install extensions
sudo pecl install ev
sudo pecl install event # at the 'Include libevent OpenSSL support [yes] :' prompt type "no".
sudo pecl install libevent
# Create configurations
echo 'extension=ev.so' | sudo tee /etc/php/7.4/mods-available/ev.ini
echo 'extension=event.so' | sudo tee /etc/php/7.4/mods-available/event.ini
echo 'extension=libevent.so' | sudo tee /etc/php/7.4/mods-available/libevent.ini
# Create symlinks
sudo phpenmod -v 7.4 ev
sudo phpenmod -v 7.4 event
sudo phpenmod -v 7.4 libevent
# Check modules are loaded
php -m | grep ev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment