I recently updated MySQL from 8.0 to 8.3 on my WSL running Ubuntu 22.4. Omeka S was working with the older version, but after the upgrade I receive the following error message:
Some installation requirements were not satisfied.
Omeka requires the PHP extension pdo_mysql, but it is not loaded.
An exception occurred in driver: could not find driver
Cann anyone help me with what the problem is and how to fix it?
For a bit of context, I tried updating the pdo with
sudo apt-get install php-mysql
and then restart Apache and MySQL, but the problem is still there.
I searched online for a solution, and it seems it has something to do with updating php.ini and/or .htaccess. Could anyone confirm if this is the case and if so how to fix it?
What do you get if you run php -m? It should be a list of installed modules. Does it have pdo_mysql, or anything similar?
If you’re getting the error you show above, it’s PHP reporting that the necessary driver for MySQL used by Omeka S isn’t there. Typically the command you report running is sufficient for installing it on an Ubuntu system, though.
So, you have the module listed there, then I’d imagine the problem is related to just the PHP that’s running in the web… maybe it didn’t get restarted, or you have more than one version of PHP installed. You could, I suppose, restart the computer entirely to be certain that PHP is restarted.
I meant just restart the whole computer to sidestep any issues with restarting things inside WSL.
Though since you’ve said you do have multiple versions installed, I’d also be extra sure that this is the version you have configured to use with your web server. You might check the /etc/apache2/conf-enabled folder, which in an Ubuntu system will normally reveal what PHP you have configured for the server.
If by restarting you meant restarting the physical machine, I have restarted multiple times since the problem began, and it is still there. I tried looking in the folder you mentioned, but I had no way of telling the php version there. This is the content of the folder after I ran ls:
I tried to create a symbolic link to php.default a different PHP version in usr/bin, but the PHP version remains to be 8.3 when I ran php -v after that. Could this be where the problem is? The command I used was: ln -sf php8.1 php.default
I have been able to solve the problem. I uninstalled all versions of PHP and clean installed PHP 8.3, followed by the pdo_mysql and xml packages. I was able to access Omeka S after that.
Thank you so much for your great suggestions, John. I really appreciate your help!