1 min read · January 23, 2018
This repository includes packages with the latest PHP versions and some most commonly used PECL extensions for the elegant PHP development experience on Alpine Linux.
On Alpine Linux add a PHP.earth repository and make it trusted:
apk add --no-cache wget ca-certificates \ && wget -O /etc/apk/keys/phpearth.rsa.pub https://repos.php.earth/alpine/phpearth.rsa.pub \ && echo "https://repos.php.earth/alpine/v3.7" >> /etc/apk/repositories
PHP.earth packages are prefixed with
apk search --no-cache php7.2*
Let's go through repository installation step by step. Before adding the repository, add wget and common CA certificates PEM files in case they haven't been added yet. This will enable downloading files from the HTTPS locations.
apk add --no-cache wget ca-certificates
Making the repository trusted is done by downloading the public key:
wget -O /etc/apk/keys/phpearth.rsa.pub https://repos.php.earth/alpine/phpearth.rsa.pub
Last step is registering the repository on APK by appending a new line in
echo "https://repos.php.earth/alpine/v3.7" >> /etc/apk/repositories
PHP.earth Alpine Linux repository is located on GitHub.