Unable to load PDO drivers

422 Views Asked by At

Getting the following error Aimeos\MW\DB\Exception: An exception occurred in driver: could not find driver.

I am running this on a LAMP. After looking around for answers I found out this is because the pdo_mysql in this case is not enabled.

I tried the following solutions:

  1. I looked at phpinfo and saw the following:

    PDO

    • PDO Support enabled
    • PDO Drivers no value

    I went to php.ini and I uncommented extension=pdo_mysql. Then I restarted Apache, I still get the same error.

  2. My Aimeos .env file is configured properly and tested since migrations worked fine during installation.

  3. I checked that pdo_mysql is there using the php -m

It is worth noting that my php cli and phpinfo are different versions, but I dont think this should be the issue. The cli is 8.2 and phpinfo version is 8.1.

I was expecting that when I restart apache to have to pdo_mysql module show up in phpinfo, or get rid of the error.

1

There are 1 best solutions below

0
bananas0102 On

I did some more digging and found an old post that led me to the solution.

It seems that I had the php8.2-mysql package, but didn't have the php8.1-mysql package. The installation requirements were met since it appears the installation process is using the cli package while the actual application was trying to use the server package.