What's new
  • Do not create multi-accounts, you will be blocked! For more information about rules, limits, and more, visit the Help Page Found a dead link? Use the report button!
  • If no files are available, please contact me or reply in the thread. I will update them immediately.

How to install or upgrade to PHP 8.3 on Ubuntu, Debian, Fedora, RHEL, CentOS

How to install or upgrade to PHP 8.3 on Ubuntu, Debian, Fedora, RHEL, CentOS
PHP 8.3, released on November 23, 2023, introduces several enhancements, including typed class constants, the json_validate() function, and improvements to randomness handling. It also comes with bug fixes and performance upgrades.

Below are the steps to install or upgrade to PHP 8.3 on Ubuntu, Debian, Fedora, RHEL, CentOS, and related distributions. These instructions use trusted repositories to ensure access to the latest PHP packages.

Install PHP 8.3 on Debian (10, 11, and 12)
Bash:
# Save existing php package list to packages.txt file
sudo dpkg -l | grep php | tee packages.txt

# Add Ondrej's repo source and signing key along with dependencies
sudo apt install apt-transport-https
sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update

# Install new PHP 8.3 packages
sudo apt install php8.3 php8.3-cli php8.3-{bz2,curl,mbstring,intl}

# Install FPM OR Apache module
sudo apt install php8.3-fpm
# OR
# sudo apt install libapache2-mod-php8.3

# On Apache: Enable PHP 8.3 FPM
sudo a2enconf php8.3-fpm
# When upgrading from an older PHP version:
sudo a2disconf php8.2-fpm

# Remove old packages
sudo apt purge php8.2*

Install PHP 8.3 on Ubuntu (20.04, 22.04, and 24.04)
Bash:
## Save existing php package list to packages.txt file
sudo dpkg -l | grep php | tee packages.txt

# Add Ondrej's PPA
sudo add-apt-repository ppa:ondrej/php # Press enter when prompted.
sudo apt update

# Install new PHP 8.3 packages
sudo apt install php8.3 php8.3-cli php8.3-{bz2,curl,mbstring,intl}

# Install FPM OR Apache module
sudo apt install php8.3-fpm
# OR
# sudo apt install libapache2-mod-php8.2

# On Apache: Enable PHP 8.3 FPM
sudo a2enconf php8.3-fpm
# When upgrading from an older PHP version:
sudo a2disconf php8.2-fpm

## Remove old packages
sudo apt purge php8.2*

Install PHP 8.3 on Fedora 37, 38, and 39
Bash:
# Save existing php package list to packages.txt file
sudo dnf list installed | grep php | tee packages.txt

# Add Remi's repo
sudo dnf install https://rpms.remirepo.net/fedora/remi-release-$(cut -d ' ' -f 3 /etc/fedora-release).rpm
sudo dnf config-manager --set-enabled remi

# Install new PHP 8.3 packages
sudo dnf install php83 php83-php-fpm

# Remove old packages
sudo dnf remove php82*

# Create symlinks from `php` to actual PHP binary
sudo dnf install php83-syspaths -y

Install PHP 8.3 on RHEL/Alma/Rocky/CentOS Stream/etc
Bash:
# Save existing php package list to packages.txt file
sudo dnf list installed | grep php | tee packages.txt

# Add Remi's repo
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(cut -d ' ' -f 4 /etc/redhat-release | cut -d '.' -f 1).noarch.rpm -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-$(cut -d ' ' -f 4 /etc/redhat-release | cut -d '.' -f 1).rpm -y

# Install new PHP 8.3 packages
sudo dnf install php83 php83-php-fpm

# Remove old packages
sudo dnf remove php82*

# Create symlinks from `php` to actual PHP binary
sudo dnf install php83-syspaths -y
 
Last edited:
Back
Top