cd $HOME
wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz
tar xzf $HOME/openssl-1.1.1i.tar.gz
cd openssl-1.1.1i
./Configure --prefix=$HOME/openssl-1.1.1i/bin -fPIC -shared linux-x86_64
make -j 8
make install
export PKG_CONFIG_PATH=$HOME/openssl-1.1.1i/bin/lib/pkgconfig && asdf install php 7.4.30
I need a PHP 7.4, and that is useful for me:
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
tar -xzvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./Configure --prefix=$HOME/project/build_lib/build_openssl/openssl-1.1.1w/bin -fPIC -shared linux-x86_64
make -j 8
make install
export PKG_CONFIG_PATH=$HOME/project/build_lib/build_openssl/openssl-1.1.1w/bin/lib/pkgconfig
asdf install php 7.4.33
asdf global php 7.4.33
Then you will end up with PHP version 7.4.33, but there are some issues with composer. Next 👇
# Download certificate https://curl.se/ca/cacert.pem
wget https://curl.se/ca/cacert.pem
1. Or use the web page to download and upload to linux
mkdir -p /usr/local/openssl/ssl/certs/
mv cacert.pem /usr/local/openssl/ssl/certs/cacert.pem
echo "openssl.cafile=/usr/local/openssl/ssl/certs/cacert.pem" >> $(asdf where php)/conf.d/php.ini
1. repeat the command for the install_composer method.
bin_path=$(asdf where php)/bin
expected_signature=$(curl -sL https://composer.github.io/installer.sig)
$bin_path/php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$bin_path/php -r "if (hash_file('sha384', 'composer-setup.php') === '${expected_signature}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$bin_path/php composer-setup.php --install-dir=$bin_path --filename=composer
$bin_path/php -r "unlink('composer-setup.php');"
$bin_path/composer --version
1. since composer was installed manually, you need to refresh the shims.
asdf reshim
That’s all!