External MySQL database (PDO MySQL extension fails to load)


I have installed HestiaCP without MySQL/MariaDB database server on it. Instead, I have a separate MariaDB database server (dockerized) on the same server.

The application (website) that I’m trying to configure in HestiaCP fails to detect de corresponding extension for pdo_mysql.

I already enabled it by uncommeting the line ‘;extension=pdo_mysql’, but what do to next from HestiaCP?

Ok, fixed it by installing it manually:
apt-get install php7.4-mysql

And no need to edit the php.ini file at all. So, I reverted it back:
Before: extension=pdo_mysql
After: ;extension=pdo_mysql

But, shouldn’t it be installed automatically by HestiaCP when we select a php package from the list to install? Or HestiaCP doesn’t install the mysql version if the use doesn’t have any local database server running within Hestia?

Yes to both questions :wink:

The script used to add PHP versions (v-add-web-php) , has in the list these packages:

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"

And it includes mysql module for php but later, it checks whether you have mysql/mariadb installed and if you didn’t install it, Hestia removes the package from the list:

if ! echo "$DB_SYSTEM" | grep -w 'mysql' > /dev/null; then
        mph=$(echo "$mph" | sed -e "s/php$version-mysql//")

Ohh, I understand now.
Thank you very much for the explanation!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.