Community GuidesConfiguration

Upgrading PHP

Move the Panel to a newer version of PHP.

Introduction

Pterodactyl 2.0 needs PHP 8.3 or 8.4. If you run an older version, such as PHP 8.1 or 8.2 from Pterodactyl 1.x, upgrade PHP before you upgrade the Panel.

Panel VersionPHP Versions
2.x8.3, 8.4
1.11.10 to 1.x8.2, 8.3

This guide upgrades Ubuntu or Debian to PHP 8.4. For PHP 8.3, replace 8.4 with 8.3 in every command.

Installing the New Version

Add the ondrej/php repository, which provides newer PHP versions for Ubuntu:

apt -y install software-properties-common
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php

On Debian, skip this step. Sury's repository, added in Getting Started, already provides newer PHP versions.

Install the new version with the extensions the Panel needs:

apt update
apt -y install php8.4 php8.4-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip,intl}

The new version becomes the default php command. Check it with:

php -v

Updating the Web Server

The web server still sends requests to the old version's PHP-FPM, so point it at the new one.

Change the PHP-FPM socket in your Panel's configuration, then reload NGINX:

sed -i -e 's/php8\.[0-9]-fpm\.sock/php8.4-fpm.sock/' /etc/nginx/sites-available/pterodactyl.conf
systemctl reload nginx

Restarting the Queue Worker

The queue worker runs the old version until you restart it:

systemctl restart pteroq

Checking the Panel

To confirm the new version has everything the Panel needs, run:

cd /var/www/pterodactyl
composer check-platform-reqs --no-dev

Then open the Panel in your browser. Once everything works, you can remove the old version, for example with apt -y purge 'php8.3*'.

Edit on GitHub

Last updated on

On this page