0

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.

  • 2
    It totally plays an role. These are 2 different PHP versions _at all_, so I'm 99.9% sure you've edited the wrong ini file. – Honk der Hase Apr 19 '23 at 17:51
  • I tried changing both php.ini files and still the same. Is there anything else I can try? Could this be an apache issue? Are modules loaded directly from the php configuration or does apache have it's own module configs? – bananas0102 Apr 19 '23 at 18:49
  • `phpinfo()` from your browser will tell you, which ini file has been loaded. Mind, there could be loaded _additional_ files via include mechanisms, so look out for those as well – Honk der Hase Apr 19 '23 at 21:36
  • How did you installed your LAMP stack? Did you install the relevant PHP module package(s)? Most Linux distribution don't need you to manually uncomment configs to enable extension. – Koala Yeung Apr 20 '23 at 02:23
  • Also, are you running PHP as mod_php or with PHP-FPM setup? – Koala Yeung Apr 20 '23 at 02:24
  • I figured you shouldn't have to uncomment manually, since all the other working modules are still commented in the ini file and still working fine. It was something I tried since it was suggested in other posts. I'm using mod_php. – bananas0102 Apr 20 '23 at 03:32

1 Answers1

0

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.