Installing NES for PHP 7
How to install NES for PHP 7 on Debian, Ubuntu, RHEL, Amazon Linux 2 and Amazon Linux 2023
Supported Platforms
| Platform | x86_64 | aarch64 |
|---|---|---|
| Debian 12 | ✅ | ✅ |
| Debian 13 | ✅ | ✅ |
| Ubuntu 22.04 | ✅ | ✅ |
| Ubuntu 24.04 | ✅ | ✅ |
| Ubuntu 26.04 | ✅ | ✅ |
| RHEL 8 (AlmaLinux 8, Rocky Linux 8) | ✅ | ✅ |
| RHEL 9 (AlmaLinux 9, Rocky Linux 9) | ✅ | ✅ |
| RHEL 10 (AlmaLinux 10, Rocky Linux 10) | ✅ | ✅ |
| Amazon Linux 2 | ✅ | ✅ |
| Amazon Linux 2023 | ✅ | ✅ |
The current release is v7.4.33-nes-7.4.3, PHP 7.4.33. Once installed, php -v shows
PHP 7.4.33-nes.
Access
NES for PHP 7 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.
Debian and Ubuntu
The packages keep the usual names (php7.4-cli, php7.4-fpm,
libapache2-mod-php7.4 and the rest), paths and configuration files, and
replace the php7.4 packages a host already has.
Download and verify
In an empty directory, download the signing key, the checksums and the repository for your distribution:
base=https://registry.nes.herodevs.com/bin/nes/php/v7.4.33-nes-7.4.3
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.4.33-nes-7.4.3.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.4.33-nes-7.4.3.*.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.4-cli php7.4-fpm php7.4-mysql.
On Debian 13 there is no php7.4-imap. Remove it (sudo apt-get remove php7.4-imap) before you upgrade a host that has it.
Check the installation:
php -v
Configure
Each PHP SAPI reads its own php.ini in /etc/php/7.4/cli/,
/etc/php/7.4/fpm/ or /etc/php/7.4/apache2/. php-fpm is the
php7.4-fpm service and listens on /run/php/php7.4-fpm.sock:
sudo systemctl enable --now php7.4-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.4 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.4 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:
base=https://registry.nes.herodevs.com/bin/nes/php/v7.4.33-nes-7.4.3
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.4.33-nes-7.4.3.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.4.33-nes-7.4.3.*.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 switch the host's PHP 7.4 module stream to NES for PHP 7, or, on a host without PHP, enable the stream and install the packages you need:
sudo dnf module switch-to php:nes-7.4
php-sodium needs libsodium from EPEL. Remove packages the stream does not have before switching (php-imap, php-pdo-dblib, php-pdo-firebird, php-tidy, php-litespeed, php-oci8 and, on RHEL 8, apcu-panel): while one is installed, the switch stops and changes nothing.
Check the installation:
php -v
On a ubi-minimal host, run microdnf reinstall tzdata after installing, or PHP's date functions fail with "Timezone database is corrupt".
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 PHP 7.4 stream you used before instead, switch to it,
for example sudo dnf module switch-to php:7.4.
Amazon Linux 2
The packages replace the php7.4 amazon-linux-extras topic's packages under
the same names.
AWS ended standard support for Amazon Linux 2 on 2026-06-30. NES for PHP 7 patches PHP, not the operating system's own packages, such as OpenSSL or libcurl.
Download and verify
In an empty directory, download the signing key, the checksums and the repository:
base=https://registry.nes.herodevs.com/bin/nes/php/v7.4.33-nes-7.4.3
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.4.33-nes-7.4.3.amazonlinux2.$arch.repo.tar.xz"; do
curl -fSLO -u "$auth" "$base/$f"
done
Then verify the downloads:
gpg --with-fingerprint RPM-GPG-KEY-php-nes # must show CA44E935A3995EB733AF292B18DD1E9212F3C6A2
gpg --import RPM-GPG-KEY-php-nes
gpg --verify SHASUMS256.txt.asc SHASUMS256.txt
ls | awk 'NR == FNR { have[$0]; next } $2 in have' - SHASUMS256.txt | sha256sum -c -
Install
sudo mkdir -p /opt/nes-php
sudo tar -xJf php-v7.4.33-nes-7.4.3.*.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 yum update
On a host without PHP, install the packages you need instead, for example
sudo yum install php-cli php-fpm php-mysqlnd.
Remove apcu-panel first (sudo yum remove apcu-panel) if it is installed. The steps are for a host without PHP or with the php7.4 topic; do not use them on a host with a PHP 8 topic.
Configure
PHP reads /etc/php.ini and /etc/php.d/. php-fpm is the php-fpm service:
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 yum clean metadata
sudo yum update
Uninstall
Return to the php7.4 topic's packages and remove the repository:
sudo yum --disablerepo=nes-php distro-sync 'php*'
sudo rm /etc/yum.repos.d/nes-php.repo
sudo rm -rf /opt/nes-php
Amazon Linux 2023
The packages follow Amazon Linux's names for a PHP version: php7.4,
php7.4-cli, php7.4-fpm and the rest. One PHP version is
installed at a time.
Download and verify
In an empty directory, download the signing key, the checksums and the repository:
base=https://registry.nes.herodevs.com/bin/nes/php/v7.4.33-nes-7.4.3
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.4.33-nes-7.4.3.amazonlinux2023.$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
Bring the host to the latest Amazon Linux 2023 release, add the repository, then install the packages you need:
sudo dnf upgrade --releasever=latest
sudo mkdir -p /opt/nes-php
sudo tar -xJf php-v7.4.33-nes-7.4.3.*.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 install php7.4-cli php7.4-fpm php7.4-mysqlnd
On a host with Amazon Linux's PHP 8, add --allowerasing and name the
php7.4 package for each PHP 8 package you have (for example
php7.4-cli for php8.4-cli): dnf then replaces PHP 8.
Configure
PHP reads /etc/php.ini and /etc/php.d/. php-fpm is the php-fpm service:
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
sudo dnf remove $(rpm -qa --qf '%{NAME} %{RELEASE}\n' | awk '$2 ~ /\.nes\./ { print $1 }')
sudo rm /etc/yum.repos.d/nes-php.repo
sudo rm -rf /opt/nes-php
To go back to Amazon Linux's PHP 8 instead, install its packages with
--allowerasing, for example sudo dnf install --allowerasing php8.4-cli php8.4-fpm.
Verify Downloads
Every release is signed with the HeroDevs release signing key.
GPG Key Fingerprint: CA44E935A3995EB733AF292B18DD1E9212F3C6A2.
- 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
- Verify the signature of the checksum file:
gpg --verify SHASUMS256.txt.asc SHASUMS256.txt
- 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.