Last active
December 9, 2021 03:30
-
-
Save ozzpy/f2b8611fb02e8bd6571b5f814f8581e3 to your computer and use it in GitHub Desktop.
php-7.4-crypt-tiburcio
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
#!/usr/bin/env bash | |
#@ozzpy | |
# | |
# | |
# Check version php and pecl | |
# | |
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php | |
pecl version | |
sudo apt-get install php-pear | |
sudo apt-get install php7.4-dev -y | |
# | |
sudo apt-get -y install gcc make autoconf libc-dev pkg-config -y | |
sudo pecl channel-update pecl.php.net | |
sudo apt-get -y install libmcrypt-dev | |
sudo apt-get install php7.4-dev -y | |
sudo pecl install mcrypt-1.0.3 # 7.4 | |
# Build process completed successfully | |
# Installing '/usr/lib/php/20190902/mcrypt.so' | |
# install ok: channel://pecl.php.net/mcrypt-1.0.3 | |
# configuration option "php_ini" is not set to php.ini location | |
# You should add "extension=mcrypt.so" to php.ini | |
# | |
# Grab installing path and add to cli and apache2 php.ini | |
# | |
# example: | |
# php 7.2 | |
#sudo bash -c "echo extension=/usr/lib/php/20170718/mcrypt.so > /etc/php/7.2/mods-available/mcrypt.ini" | |
# php 7.4 | |
sudo bash -c "echo extension=/usr/lib/php/20190902/mcrypt.so > /etc/php/7.4/mods-available/mcrypt.ini" | |
sudo ln -s /etc/php/7.4/mods-available/mcrypt.ini /etc/php/7.4/fpm/conf.d/20-mcrypt.ini | |
sudo ln -s /etc/php/7.4/mods-available/mcrypt.ini /etc/php/7.4/cli/conf.d/20-mcrypt.ini | |
# check that the extension was installed with this command: | |
php -i | grep mcrypt | |
#raphf | |
sudo pecl install raphf | |
#Build process completed successfully | |
#Installing '/usr/include/php/20190902/ext/raphf/php_raphf.h' | |
#Installing '/usr/include/php/20190902/ext/raphf/php_raphf_api.h' | |
#Installing '/usr/lib/php/20190902/raphf.so' | |
sudo bash -c "echo extension=/usr/lib/php/20190902/raphf.so > /etc/php/7.4/mods-available/raphf.ini" | |
sudo ln -s /etc/php/7.4/mods-available/raphf.ini /etc/php/7.4/fpm/conf.d/20-raphf.ini | |
# GRPC | |
sudo bash -c "echo extension=/usr/lib/php/20190902/grpc.so > /etc/php/7.4/mods-available/grpc.ini" | |
sudo ln -s /etc/php/7.4/mods-available/grpc.ini /etc/php/7.4/fpm/conf.d/20-grpc.ini | |
# PROTOBUF | |
sudo bash -c "echo extension=/usr/lib/php/20190902/protobuf.so > /etc/php/7.4/mods-available/protobuf.ini" | |
sudo ln -s /etc/php/7.4/mods-available/protobuf.ini /etc/php/7.4/fpm/conf.d/20-protobuf.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment