Visit NES for PHP 7 Home Page

Installing NES for PHP 7.2

How to install NES for PHP 7.2 on Debian, Ubuntu and RHEL

Supported Platforms

Platformx86_64aarch64
Debian 12✅✅
Ubuntu 22.04✅✅
Ubuntu 24.04✅✅
RHEL 8 (AlmaLinux 8, Rocky Linux 8)✅✅
RHEL 9 (AlmaLinux 9, Rocky Linux 9)✅✅

The current release is v7.2.34-nes-7.2.1, PHP 7.2.34. Once installed, php -v shows PHP 7.2.34-nes.

Access

NES for PHP 7.2 is distributed through the NES registry at registry.nes.herodevs.com and requires an access token. If you do not have one, contact support@herodevs.com. For more information, see Access Tokens.

The files of a release are at https://registry.nes.herodevs.com/bin/nes/php/<release>/<file>. Authenticate with your contact e-mail and your access token.

Extensions

NES for PHP 7.2 keeps PHP 7.2's extension API: the PHP API version is 20170718 and the Zend extension API version 320170718. An extension built for PHP 7.2 with the same thread-safety keeps loading without a rebuild. php -i shows the build's API version and thread-safety in its Extension Build line (API20170718,NTS for the standard builds).

Debian and Ubuntu

The packages keep the usual names (php7.2-cli, php7.2-fpm, libapache2-mod-php7.2 and the rest), paths and configuration files, and replace the php7.2 packages a host already has.

Download and verify

In an empty directory, download the signing key, the checksums and the repository for your distribution:

Debian 12
Ubuntu 22.04
Ubuntu 24.04
base=https://registry.nes.herodevs.com/bin/nes/php/v7.2.34-nes-7.2.1
auth="<your-contact-email>:<your-nes-access-token>"
arch=$(dpkg --print-architecture)
for f in RPM-GPG-KEY-php-nes SHASUMS256.txt SHASUMS256.txt.asc "php-v7.2.34-nes-7.2.1.debian12.$arch.repo.tar.xz"; do
  curl -fSLO -u "$auth" "$base/$f"
done

Then verify the downloads:

gpg --show-keys RPM-GPG-KEY-php-nes    # must show CA44E935A3995EB733AF292B18DD1E9212F3C6A2
gpg --import RPM-GPG-KEY-php-nes
gpg --verify SHASUMS256.txt.asc SHASUMS256.txt
sha256sum -c --ignore-missing SHASUMS256.txt

Install

Add the repository, then upgrade the PHP packages the host has:

sudo mkdir -p /opt/nes-php
sudo tar -xJf php-v7.2.34-nes-7.2.1.*.repo.tar.xz -C /opt/nes-php --strip-components=1
sudo cp /opt/nes-php/nes-php.list /etc/apt/sources.list.d/nes-php.list
sudo apt update
sudo apt upgrade

On a host without PHP, install the packages you need instead, for example sudo apt install php7.2-cli php7.2-fpm php7.2-mysql.

Check the installation:

php -v

Configure

Each PHP SAPI reads its own php.ini in /etc/php/7.2/cli/, /etc/php/7.2/fpm/ or /etc/php/7.2/apache2/. php-fpm is the php7.2-fpm service and listens on /run/php/php7.2-fpm.sock:

sudo systemctl enable --now php7.2-fpm

Upgrade

Download and verify the new release's repository as above, then:

sudo rm -rf /opt/nes-php && sudo mkdir -p /opt/nes-php
sudo tar -xJf php-<release>.*.repo.tar.xz -C /opt/nes-php --strip-components=1
sudo apt update
sudo apt upgrade

Uninstall

Remove the NES packages, the ones whose version contains nes:

sudo apt purge $(dpkg-query -W -f '${db:Status-Abbrev} ${Package} ${Version}\n' | awk '$1 ~ /^i/ && $3 ~ /[.+]nes[0-9]/ && $2 != "php-common" { print $2 }')
sudo rm /etc/apt/sources.list.d/nes-php.list
sudo rm -rf /opt/nes-php

To go back to the PHP 7.2 packages you used before instead, keep their repository configured and install their versions with sudo apt install --allow-downgrades <package>=<version>.

RHEL, AlmaLinux and Rocky Linux

The packages are the php:nes-7.2 module stream, with the usual package names (php-cli, php-fpm, php-mysqlnd and the rest), paths and configuration files.

Download and verify

In an empty directory, download the signing key, the checksums and the repository for your RHEL version:

RHEL 8
RHEL 9
base=https://registry.nes.herodevs.com/bin/nes/php/v7.2.34-nes-7.2.1
auth="<your-contact-email>:<your-nes-access-token>"
arch=$(uname -m)
for f in RPM-GPG-KEY-php-nes SHASUMS256.txt SHASUMS256.txt.asc "php-v7.2.34-nes-7.2.1.el8.$arch.repo.tar.xz"; do
  curl -fSLO -u "$auth" "$base/$f"
done

Then verify the downloads:

gpg --show-keys RPM-GPG-KEY-php-nes    # must show CA44E935A3995EB733AF292B18DD1E9212F3C6A2
gpg --import RPM-GPG-KEY-php-nes
gpg --verify SHASUMS256.txt.asc SHASUMS256.txt
sha256sum -c --ignore-missing SHASUMS256.txt

Install

Add the repository:

sudo mkdir -p /opt/nes-php
sudo tar -xJf php-v7.2.34-nes-7.2.1.*.repo.tar.xz -C /opt/nes-php --strip-components=1
sudo cp /opt/nes-php/nes-php.repo /etc/yum.repos.d/nes-php.repo

Then enable the php:nes-7.2 module stream. A host that has PHP from another stream (RHEL 8's php:7.2, or a PHP 8 stream) switches to it; a host without PHP enables it and installs the packages you need:

Switch
New host
sudo dnf module switch-to php:nes-7.2

Check the installation:

php -v

Configure

PHP reads /etc/php.ini and /etc/php.d/. php-fpm is the php-fpm service and listens on /run/php-fpm/www.sock:

sudo systemctl enable --now php-fpm

Upgrade

Download and verify the new release's repository as above, then:

sudo rm -rf /opt/nes-php && sudo mkdir -p /opt/nes-php
sudo tar -xJf php-<release>.*.repo.tar.xz -C /opt/nes-php --strip-components=1
sudo cp /opt/nes-php/nes-php.repo /etc/yum.repos.d/nes-php.repo
sudo dnf upgrade --refresh

Uninstall

Remove the NES packages, reset the module and remove the repository:

sudo dnf remove $(rpm -qa --qf '%{NAME} %{RELEASE}\n' | awk '$2 ~ /\.nes\./ { print $1 }')
sudo dnf module reset php
sudo rm /etc/yum.repos.d/nes-php.repo
sudo rm -rf /opt/nes-php

To go back to the distribution's PHP instead, enable the stream you want after the reset and install its packages: RHEL 8 has a php:7.2 stream (sudo dnf module switch-to php:7.2), RHEL 9 has none for PHP 7.2, so there choose one from dnf module list php, for example sudo dnf module switch-to php:<stream>.

Verify Downloads

Every release is signed with the HeroDevs release signing key.

GPG Key Fingerprint: CA44E935A3995EB733AF292B18DD1E9212F3C6A2.

  1. Import the key from a key server, or from the release's RPM-GPG-KEY-php-nes:
gpg --keyserver keys.openpgp.org --recv-keys CA44E935A3995EB733AF292B18DD1E9212F3C6A2
  1. Verify the signature of the checksum file:
gpg --verify SHASUMS256.txt.asc SHASUMS256.txt
  1. Verify the checksums of the downloaded files:
sha256sum -c --ignore-missing SHASUMS256.txt

The package managers also check every package's signature when they install it.