Fix: Fatal error: Uncaught Error: Call to undefined function mysql_connect() in …

When setting up my WordPress site on OpenBSD 6.7 using this nice tutorial I ran into an error during installation. I enabled Debug mode in WordPress by setting WP_DEBUG to true in wp-config.php

define( 'WP_DEBUG', true );

This allowed me to to see the real errors from PHP, etc. I then was handed the following error:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in … <path>

I was able to resolve this issue by enabling the mysqli plugin in /etc/php-7.4.ini.

Just remove the semi-colon in front of the line:

;extension=mysqli

So after removing that semicolon in your favorite text editor:

# grep ^extension=mysqli /etc/php-7.4.ini
extension=mysqli
#

After that was smooth sailing. This was with PHP-7.4.x on OpenBSD.

This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply