Created
November 4, 2019 11:58
-
-
Save Mecanik/d2314fbc860b9c68eac4b101127b738e to your computer and use it in GitHub Desktop.
Install and configure PHP 7.3 ev/event PECL extension on Ubuntu Linux 18.04.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For phpize | |
apt install php7.3-dev | |
# Install extensions | |
pecl install ev | |
pecl install event | |
# Create configurations | |
sudo echo 'extension=ev.so' > /etc/php/7.3/mods-available/ev.ini | |
sudo echo 'extension=event.so' > /etc/php/7.3/mods-available/event.ini | |
# Create symlinks | |
sudo ln -s /etc/php/7.3/mods-available/ev.ini /etc/php/7.3/fpm/conf.d/20-ev.ini | |
sudo ln -s /etc/php/7.3/mods-available/ev.ini /etc/php/7.3/cli/conf.d/20-ev.ini | |
sudo ln -s /etc/php/7.3/mods-available/event.ini /etc/php/7.3/fpm/conf.d/20-event.ini | |
sudo ln -s /etc/php/7.3/mods-available/event.ini /etc/php/7.3/cli/conf.d/20-event.ini | |
# Optional - libevent | |
## WANRING! Segmentation fault on PHP 7.3.11-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 24 2019 18:23:23) ( NTS ) ## | |
sudo echo 'extension=libevent.so' > /etc/php/7.3/mods-available/libevent.ini | |
sudo ln -s /etc/php/7.3/mods-available/libevent.ini /etc/php/7.3/fpm/conf.d/20-libevent.ini | |
sudo ln -s /etc/php/7.3/mods-available/libevent.ini /etc/php/7.3/cli/conf.d/20-libevent.ini | |
# Check modules loaded: | |
php -i | grep -i ev | |
php -i | grep -i event | |
# Optional - Restart FPM | |
sudo service php7.3-fpm restart | |
Enjoy! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the start you also want to run
sudo apt install libevent-dev
And choose 'no' at the 'Include libevent OpenSSL support [yes] :' prompt. Since
sudo apt install libssl1.0-dev
(OpenSSL) will removephp7.3-dev
, which is necessary for compilation.In a lot of cases (on Ubuntu 18.04 & 20.04) you may afterwards want to reinstall
sudo apt install libssl1.0-dev node-gyp nodejs-dev npm
🙈🤷♂️🤦♂️When you use npm/node anywhere in your system.
https://bugs.launchpad.net/ubuntu/+source/nodejs/+bug/1794589
The proper syntax for the .ini file creation is with
sudo tee
(--append
?):