dnf or yum can be used to install the PHP PDO driver for mySQL / MariaDB on a Linux Red Hat distribution (CentOS, Fedora, Red Hat).

dnf install php-mysqlnd

Something like this should be returned. Notice in this example that php-pdo-7.4.19-1.fc34.x86_64 was installed.

Installed:
  php-mysqlnd-7.4.19-1.fc34.x86_64
  php-pdo-7.4.19-1.fc34.x86_64

The following files should have been installed.

/etc/php.d/20-pdo.ini
/etc/php.d/30-pdo_mysql.ini
/etc/php.d/30-pdo_sqllite.ini

Additionally, phpinfo.php should return something like this.

There is no need to restart PHP or mySQL or MariaDB for this change to take effect.

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐