Skip to content

Instantly share code, notes, and snippets.

@cwhsu1984
Last active August 23, 2018 12:03
Show Gist options
  • Save cwhsu1984/e13d4648ddd7723eabd2a01b9dffcf15 to your computer and use it in GitHub Desktop.
Save cwhsu1984/e13d4648ddd7723eabd2a01b9dffcf15 to your computer and use it in GitHub Desktop.
upgrade from php7.1 to php7.2 with mcrypt
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.2 php7.2-fpm php7.2-xml php-dev php-pear libmcrypt-dev
sudo pecl install mcrypt-snapshot
# add mcrypt.so to php cli and fpm
sudo bash -c "echo 'extension=mcrypt.so' >> /etc/php/7.2/cli/php.ini"
sudo bash -c "echo 'extension=mcrypt.so' >> /etc/php/7.2/fpm/php.ini"
# change nginx site-availables to use php7.2-fpm
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# tell systemd to switch from php7.1 to php7.2
sudo systemctl disable php7.1-fpm
sudo systemctl stop php7.1-fpm
sudo systemctl enable php7.2-fpm
sudo systemctl start php7.2-fpm
# some other references
# https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
# https://serverpilot.io/community/articles/how-to-install-the-php-mcrypt-extension.html
@nishanth6
Copy link

Issue Solved when installing php7.2-mcrypt

I was also facing the same issue. Check this link https://stackoverflow.com/q/48275494/7713811 to get the right solution for installing it in PHP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment