A PDO database driver is required! (for Drupal and similar CMS platforms)

You need to enable the PDO_MYSQL database driver for PHP 5.3.3 or higher so that Drupal 7 can access the database. See the system requirements page for more information.
The error above is encountered when migrating and transferring an old Drupal 7 website from one hosting to another.

The database version of the D7 website is at 10.5.26-MariaDB. While both the website’s D7 version at 7.101 and new webhosting (target host database) already support PHP version 8.2, we need to configure the hosting to support the pdo_mysql database driver.

cPanel

To enable the pdo_mysql database driver in the cPanel:

  1. Login to your cPanel account
  2. Find “PHP” from the search field, choose “Select PHP Version”, this will lead you to the PHP administration interfacecpanel-webhosting-find-php-extensions
  3. While at this, an opportunity to identify and select the correct PHP version being used depending on the CMS platform core version, in this case, Drupal 7.1xx which recommends and supports PHP version 8.2cpanel-webhosting-select-change-php-versions
  4. Enable the PDO MySQL driver. By default, the PHP extension (of database driver) pdo_mysql is disabled. Find this on the page (Ctr+F to quickly find it), and check/select to enable. This action auto-saves the settings. Please note this will conflict with nd_pdo_mysql is that is enabled, you need to disable nd_pdo_mysql before enabling pdo_mysql. You can only use one of these.cpanel-webhosting-php-extensions-enable-pdo-mysql-database-driver

That’s it! For Drupal, just run /update.php (requires enabling this from the settings.php, set $update_free_access = TRUE;) to update the database via public browsing. The website should now be working fine after running the DB updates. Don’t forget to turn off update_free_access back to FALSE again! This is a major security risk!

drupal-7-update-free-access-settings-php

For other CMS or platforms, this should immediately fix the issue and the website will now load properly.