/ gpg

Ubuntu 16.04 - Install GPG Extension for PHP 7

Below is a script you can run to install the GPG extension for the PHP 7.0 CLI on Ubuntu 16.04. It may work on other distributions and versions of PHP, but I have not tested that.


sudo apt install libgpgme11-dev php-pear php7.0-dev -y
sudo pecl install gnupg

# Update the php.ini files for Apache and the CLI
SEARCH=";   extension=msql.so"
REPLACE=";   extension=msql.so\nextension=gnupg.so"
sudo sed -i "s?$SEARCH?$REPLACE?" $FILEPATH

If you need to add it for php in Apache, then also run:

sudo sed -i "s?$SEARCH?$REPLACE?" $FILEPATH
Stuart Page

Stuart Page

Stuart is a software developer with a passion for Linux and open source projects.

Read More