0

I'm running php 8 on Linux Mint and have installed it by compiling the source code (a first for me). I've also had success compiling and installing several php extensions. However, i'm having trouble installing the "pdo_mysql" extension.

I've already compiled and installed the "mysqlnd" module. However, this issue arrises after I compile and install the "pdo_mysql" module:

$ php -m

PHP Warning:  Cannot load module "pdo_mysql" because required module "mysqlnd" is not loaded in Unknown on line 0

Has anyone else encountered this or know a fix for it?

Thank you

2 Answers2

0

Try

sudo apt install php8.0-mysql

Manuel Glez
  • 890
  • 3
  • 12
  • No luck with that, the reason I compiled PHP from scratch instead of using apt was that I require PHP 8 for a project I am working on and apt does not have php8 yet for my distro. – Alexandre Pineau Jun 19 '22 at 23:45
  • Add Ondřej PPA repository nad install from there. https://linuxhint.com/install-php-8-on-linux-mint-20/ – Manuel Glez Jun 19 '22 at 23:48
0

Fixed problem by recompiling PHP as a whole with pdo mysql option:

./configure --with-pdo-mysql=mysqlnd

This is opposed to compiling and installing the mysqlnd extension on its own after having already compiled PHP.

I'm going to assume that if you want those extensions enabled, you must declare so while compiling PHP itself, given that compiling and install them seperately did not work for me.