Installing PHP 8.4

Edit /usr/local/hestia/install/upgrade/upgrade.conf and add "8.4" to multiphp_v:

multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3" "8.4")

Edit /usr/local/hestia/web/edit/server/index.php and add "php-8.4", to $v_php_versions:

$v_php_versions = [
        "php-5.6",
        "php-7.0",
        "php-7.1",
        "php-7.2",
        "php-7.3",
        "php-7.4",
        "php-8.0",
        "php-8.1",
        "php-8.2",
        "php-8.3",
        "php-8.4",
];

Edit /usr/local/hestia/bin/v-run-cli-cmd and add 'php8.4' to basecmd:

if [ "$basecmd" != 'ps' -a \
        "$basecmd" != 'ls' -a \
        "$basecmd" != 'tar' -a \
        "$basecmd" != 'zip' -a \
        "$basecmd" != 'unzip' -a \
        "$basecmd" != 'gzip' -a \
        "$basecmd" != 'gunzip' -a \
        "$basecmd" != 'mkdir' -a \
        "$basecmd" != 'find' -a \
        "$basecmd" != 'id' -a \
        "$basecmd" != 'grep' -a \
        "$basecmd" != 'egrep' -a \
        "$basecmd" != 'sed' -a \
        "$basecmd" != 'cat' -a \
        "$basecmd" != 'php5.6' -a \
        "$basecmd" != 'php7.0' -a \
        "$basecmd" != 'php7.1' -a \
        "$basecmd" != 'php7.2' -a \
        "$basecmd" != 'php7.3' -a \
        "$basecmd" != 'php7.4' -a \
        "$basecmd" != 'php8.0' -a \
        "$basecmd" != 'php8.1' -a \
        "$basecmd" != 'php8.2' -a \
        "$basecmd" != 'php8.3' -a \
        "$basecmd" != 'php8.4' -a \
        "$basecmd" != 'php' -a \
        "$basecmd" != "wp" -a \
        "$basecmd" != 'composer' ]; then
        check_result "$E_FORBIDEN" "Error: Cli command not enabled"
fi

Edit: I forgot to modify /usr/local/hestia/bin/v-restart-service to add "php8.4-fpm":

        elif [ -z "$restart" -o "$restart" = "no" ] && [ \
                "$service" = "nginx" -o \
                "$service" = "apache2" -o \
                "$service" = "exim4" -o \
                "$service" = "dovecot" -o \
                "$service" = "bind9" -o \
                "$service" = "named" -o \
                "$service" = "vsftpd" -o \
                "$service" = "php5.6-fpm" -o \
                "$service" = "php7.0-fpm" -o \
                "$service" = "php7.1-fpm" -o \
                "$service" = "php7.2-fpm" -o \
                "$service" = "php7.3-fpm" -o \
                "$service" = "php7.4-fpm" -o \
                "$service" = "php8.0-fpm" -o \
                "$service" = "php8.1-fpm" -o \
                "$service" = "php8.2-fpm" -o \
                "$service" = "php8.3-fpm" -o \
                "$service" = "php8.4-fpm" -o \
                "$service" = "proftpd" -o \
                "$service" = "ssh" -o \
                "$service" = "fail2ban" ]; then
                systemctl reload-or-restart "$service" >> $log 2>&1
        else

As php 8.4 is now available on Sury’s repository, you can install it using Hestia’s Web UI or run this script from command line:

v-add-web-php 8.4

UPDATE: seems there is a problem loading imagick library so you should wait before installing php 8.4.

UPDATE 2: imagick module has been fixed so no more library errors.

Hestia usually doen’t modify php.ini files, only for security reasons. If something is overwritting the files is your OS (dpkg), always use Keep current conf when updating packages.

4 Likes