PHP Configuration Surprise

I just install HestiaCP on server and to my surprise under Multi PHP environment it doesn’t install MySQL Library for PHP.

Also It is installing PHP 5, PHP 7 by default … doesn’t it should install it only on demand like we have Server Configuration setting in Panel that install or deinstall them. For Security I think they are disable by default and only 8.3, 8.2 and 8.1 should be install (or for that matter that are not out of support.

If you installed MariaDB or MySQL 8 then phpX.Y-mysql packages should be installed.

[...]
# Define software versions
HESTIA_INSTALL_VER='1.8.11'
# Dependencies  
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3")
fpm_v="8.2"     
mariadb_v="10.11"
        
# Defining software pack for all distros
software="acl apache2 apache2-suexec-custom apache2-suexec-pristine apache2-utils awstats bc bind9 bsdmainutils bsdutils
  clamav-daemon cron curl dnsutils dovecot-imapd dovecot-managesieved dovecot-pop3d dovecot-sieve e2fslibs e2fsprogs
  exim4 exim4-daemon-heavy expect fail2ban flex ftp git hestia=${HESTIA_INSTALL_VER} hestia-nginx hestia-php idn2
  imagemagick ipset jq libapache2-mod-fcgid libapache2-mod-php$fpm_v libapache2-mpm-itk libmail-dkim-perl lsb-release
  lsof mariadb-client mariadb-common mariadb-server mc mysql-client mysql-common mysql-server net-tools nginx openssh-server
  php$fpm_v php$fpm_v-apcu php$fpm_v-bz2 php$fpm_v-cgi php$fpm_v-cli php$fpm_v-common php$fpm_v-curl php$fpm_v-gd
  php$fpm_v-imagick php$fpm_v-imap php$fpm_v-intl php$fpm_v-ldap php$fpm_v-mbstring php$fpm_v-mysql php$fpm_v-opcache
  php$fpm_v-pgsql php$fpm_v-pspell php$fpm_v-readline php$fpm_v-xml php$fpm_v-zip postgresql postgresql-contrib
  proftpd-basic quota rrdtool rsyslog spamd sudo sysstat unrar-free unzip util-linux vim-common vsftpd xxd whois zip zstd"
[...]
[...]
if [ "$phpfpm" = "yes" ]; then
        if [ "$multiphp" = 'yes' ]; then
                for v in "${multiphp_v[@]}"; do
                        echo "[ * ] Installing PHP $v..."
                        $HESTIA/bin/v-add-web-php "$v" > /dev/null 2>&1
                done
        else
                echo "[ * ] Installing PHP $fpm_v..."
                $HESTIA/bin/v-add-web-php "$fpm_v" > /dev/null 2>&1
        fi
[...]

if you check v-add-web-php script, you will see it will install phpX.Y-mysql package.

mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli php$version-curl
     php$version-fpm php$version-gd php$version-intl php$version-mysql
     php$version-soap php$version-xml php$version-zip php$version-json php$version-bz2
     php$version-pspell php$version-imagick php$version-pgsql php$version-imap php$version-ldap"
[...]
   apt-get -qq update
   apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&1 &

If you don’t want to install all of them don’t use the option --multiphp yes when installing Hestia so it will only install current default (php 8.2) and after the install you could add the versions you want from Web UI or using command v-add-web-php.

But this conditional package installation is somewhat wrong. For performance and other reason we might install MYSQL on different server than where we have Hestia. Yes it cannot manage it but still PHP site mostly need mysql mod even for MariaDB. So package should install unconditional is better.

For multi PHP Yes I understand we skip at installation, but my point is default option should always be best option in this case out of support package is not good idea. having 2 PHP version means Multi PHP environment. Hope I make sense.

Current Multi PHP installation sucks a bit in the 1.9.0 you can select the versions you want via the install command…