How can we help you?

How to enable MySQLi for my domain?

Henry Blake
Written by
Henry Blake

Getting “Call to undefined function mysqli_connect()” errors? Yeah, that’s MySQLi not being enabled. Happens more often than you’d think, especially after migrating WordPress sites or installing certain plugins.

Here’s the thing - CloudLinux lets you turn MySQLi on and off per domain, which is actually pretty handy when you’re juggling multiple sites. Some older scripts break with newer extensions, so having domain-level control saves headaches.

Here's how to flip it on:
  1. Log into cPanel for your domain
  2. Find “Select PHP Version” (it’s in the Software section)
  3. Switch PHP to something other than “native” - PHP 8.1 or 8.2 work great
  4. Look for “mysqli” in the extensions list and check the box
  5. Hit “Save”

That’s it. No waiting around for server restarts.

Note

Quick heads-up:

  • This only works in cPanel, not WHM (if you’re a reseller)
  • Changes happen instantly
  • If MySQLi was “enabled” but still throwing errors, try switching PHP versions first - sometimes that kicks things back into gear
  • Old sites might also need the ancient “mysql” extension, but honestly, time to upgrade those

When things go sideways:

Can’t find MySQLi in the extensions? Switch off “native” PHP first. Native versions are locked down and don’t show all the module options.

Still getting database errors after enabling it? Double-check your wp-config.php or connection strings. MySQLi doesn’t magically fix wrong passwords or typos in database names.

And yeah, MySQLi is way faster than the old mysql extension, especially if your app uses prepared statements. Worth the switch.