How to enable MySQLi extension on web-server

Before going to enable it on the server, I will share some ideas about MySQLi. Then, I should explain how we can enable MySQLi on a cpanel server and How we can check if MySQLi is already enabled or not in the server.

What is MySQLi?

Simply it’s a MySQL extension for PHP programming language. The MySQLi Extension (MySQL Improved) is a relational database driver used in the PHP programming language to provide an interface with MySQL databases.

The developers of the PHP programming language recommend using MySQLi when dealing with MySQL server versions 4.1.3 and newer (takes advantage of new functionality). The MySQLi extension has a lot of benefits, some of them are listed below:

  • An object-oriented interface
  • Support for prepared statements
  • Support for multiple statements
  • Support for transactions
  • Enhanced debugging support
  • Embedded server support
  • Powerful Functionality

How to check the MySQLi extension is enabled or not on server?

You can check the MySQLi extension from command line itself by executing the following command.

# php -m | grep mysql

how to enable MySQLi extension on web-server with cPanel?

EasyApache 3

We can simply enable the MySQLi extension by rebuilding the web-server with Easyapache script. It is very simple, just run the below pasted scripts from the command line as root user, and select the MySQLi from the extension list. See the attached image for more details:

# /scripts/easyapache 


EasyApache 4

You can directly enable it from the WHM panel. Please do the following steps to enable it.

Step 1 : Log into WHM panel.

Step 2 : Go to Home » Software » EasyApache 4

Step 3 : Click on “Customize

Step 4 : Go to PHP Extensions

In EasyApache 4, the mysqli extension is provided by the mysqlnd package. To illustrate this, here is a list of the files that are provided by the ea-php55-php-mysqlnd package.

# rpm -ql ea-php55-php-mysqlnd

how to enable MySQLi extension on web-server without cPanel?

In a server without cPanel, you need to compile the MySQL with the MySQLi extension.

# ./configure --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config

How to check the MySQLi extension is enabled on server?

# php -m|grep mysql

That’s it 🙂

Related links:

Installation of Tomcat and adding JSP support for a domain on a cpanel server
How to enable mod_deflate in apache

Arunlal Ashok

Linux Cloud Infrastructure / DevOps Engineer. I'm dealing Linux servers since 2012. I started this blog to share and discuss my ideas.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team

16 Responses

  1. Kamal says:

    Thanks Man this really helped me as I needed to relocate one of my wordpress websites using the Duplicator plugin and i was jammed up due the the MySQLi Extension not running. Your guide made it very easy for me and I’m not a server guy 🙂 Thanks!

  2. Shaun Thomson says:


    Just wondering if rebuilding the web-server with easyapache erases any current mysql database you have up?


  3. Ayman Bitar says:

    Perfect. Accurate and straight to the point!

  4. Steve says:

    i set up pay per download on the back end on wordpress 4.1 when i click on preview i get this :

    need to install PHP 5.2+ and MySQL 5.5+

  5. ashish says:

    can you help me solve this error…
    “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”


  6. Neurofemsz says:

    please i need to solve this problem
    Fatal error: Call to undefined function mysqli_connect() ininc/_config.php on line 9

  7. okikiayo says:

    i am having this error “Call to undefined function mysqli_connect()”, i found out that mysqli extension isn’t installed on godaddy. i have uploaded the php.ini file and and tried to enable it
    but it doesn’t still work

  8. Piet Rietveld says:

    can you help me solve this error…
    “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *