How to access the APT repositories

Step by step instructions to setup the PHP LTS repositories.

The package repositories hosting the various PHP releases are private. That means that only customers of this service can get access to them.

This document explains the various options available and the required steps to configure those repositories.

Installing the freexian archive GPG key

All the package repositories are signed with the following GPG key:

sec   rsa4096 2020-08-14 [SCEA] [expires: 2027-12-06]
      135709AE1EB277A46E71572620DC56A105636A88
uid           [ultimate] PHP LTS <php-support@freexian.com>

To enable this key in your APT configuration, you have the following choices:

  • manually install the freexian-archive-keyring package with wget https://php.freexian.com/public/freexian-archive-keyring.deb && sudo dpkg -i freexian-archive-keyring.deb
  • manually fetch the key with sudo wget https://php.freexian.com/public/archive-key.gpg -O /etc/apt/trusted.gpg.d/freexian-archive-php.gpg
  • configure the repository in APT and install freexian-archive-keyring with apt install --allow-unauthenticated freexian-archive-keyring

You might want to double check that the key fingerprint outputted by apt-key finger matches the one shown above.

Configure APT’s sources.list

Use a customer specific URL

Once you have paid your subscription to the service, you will be granted a unique URL (that embeds a username and a private token) that you can use as an APT repository. The sources.list entry will look like this:

deb http://php.freexian.com/c/$USERNAME-$TOKEN $CODENAME main

Depending on your interest, $CODENAME can be either stretch, buster, bullseye, bookworm, trixie for Debian releases, or xenial, bionic, focal, jammy, noble for Ubuntu releases. $USERNAME and $TOKEN are given to you by Freexian.

A sample entry for Debian 10 buster could look like this:

deb http://php.freexian.com/c/john-y3aRBSgNyrWBkWRXyD7X7jYrP31MS2IZ buster main

That URL will be usable from any IP address but if we detect that the URL has leaked to third parties, we might disable the URL and require you to use a new one.

Host a private mirror of the package repository

Customers of the “enterprise” offers will be granted personal access credentials for the rsync service allowing them to host a mirror of the full package repository. See the documentation to learn how to setup such a mirror.