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 Version | PHP Versions |
|---|---|
| 2.x | 8.3, 8.4 |
| 1.11.10 to 1.x | 8.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/phpOn 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 -vUpdating 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 nginxRestarting the Queue Worker
The queue worker runs the old version until you restart it:
systemctl restart pteroqChecking the Panel
To confirm the new version has everything the Panel needs, run:
cd /var/www/pterodactyl
composer check-platform-reqs --no-devThen open the Panel in your browser. Once everything works, you can remove the old version, for example with apt -y purge 'php8.3*'.
Last updated on