WordPress complains about missing MySQL extension in PHP - How to resolve?

Hey folks, I’m stuck with a WordPress error. It says my PHP setup doesn’t have the MySQL extension. But here’s the weird part - MySQLi is working, and so is MySQL itself. I’m using a Zyxel NSA310 NAS with FFP 0.7.

I’ve been messing with my php.ini file (it’s in ffp/etc/php.ini). I’ve uncommented a bunch of stuff, including MySQL-related extensions. Here’s a snippet:

extension=/ffp/lib/extensions/no-debug-non-zts-20100525/mysql.so
extension=php_mysql.dll
extension=php_mysqli.dll
extension=pdo_mysql.so

When I run phpinfo(), it shows MySQLi is active, but not MySQL. PHPMyAdmin works fine too.

Oh, and there’s this weird thing with mysqld. It makes a shortcut from root to ffp/opt/mysql.., but it vanishes when I reboot the NAS.

Any ideas on how to fix this MySQL extension issue? Or maybe a workaround for the disappearing shortcut? Thanks!

hey sarahj, sounds like a tricky situation! have u tried manually copying the mysql.so file to the extensions directory? sometimes that does the trick. also, double-check ur php version - older wordpress might not play nice with newer php. good luck!

I’ve dealt with this exact issue before on my NAS setup. It’s a real headache, but there’s a workaround that might help. Instead of messing with the php.ini file, try adding this to your wp-config.php:

define(‘WP_USE_EXT_MYSQL’, false);

This forces WordPress to use MySQLi, which you mentioned is working. It’s a band-aid solution, but it should get you up and running.

For the disappearing shortcut problem, I’d suggest creating a startup script that recreates the symlink on boot. You can usually add custom scripts to your NAS’s startup sequence through the web interface or by SSH’ing in and modifying the appropriate init files.

Lastly, consider upgrading your WordPress if possible. Newer versions handle these database connections much better and are less likely to throw these kinds of errors. Just remember to backup everything before making any major changes!

Have you considered switching to MySQLi or PDO_MySQL? Since you mentioned MySQLi is working, you might be able to resolve this by updating WordPress to a newer version that doesn’t rely on the old MySQL extension. The error you’re seeing is likely because WordPress is looking for the deprecated mysql.so file.

If updating isn’t an option, you could try adding this to your wp-config.php file:

define(‘WP_USE_EXT_MYSQL’, false);

This tells WordPress to use MySQLi instead of the old MySQL extension. Just be cautious and back up your site before making changes.

As for the disappearing shortcut issue, it sounds like a startup script problem. You might want to check your NAS’s documentation for how to create persistent symlinks or add commands to the startup sequence.