How to Enable MySQL Extension Using cPanel

How to Enable MySQL Extension Using cPanel

Introduction

MySQL is a powerful and widely-used relational database management system that is essential for many web applications. Enabling the MySQL extension in your cPanel is crucial for the functionality of your applications, such as content management systems (CMS) like WordPress, Joomla, or custom PHP applications. This guide will walk you through the steps to enable the MySQL extension in cPanel, ensuring that your applications can connect to the database seamlessly.

Step-by-Step Guide to Enable MySQL Extension

Step 1: Log in to cPanel

  1. Open your web browser and navigate to your cPanel login page, usually found at https://yourdomain.com/cpanel.
  2. Enter your username and password to log in.

Step 2: Access the Software Section

  1. Once logged in, scroll down to the Software section of the cPanel dashboard.
  2. Click on Select PHP Version. This option allows you to manage the PHP settings for your account.

Step 3: Select the PHP Version

  1. In the Select PHP Version interface, you will see a dropdown menu that displays the PHP versions available on your server.
  2. Choose the PHP version you want to use. It’s generally recommended to select the latest stable version for better performance and security.

Step 4: Enable MySQL Extension

  1. After selecting the PHP version, you will see a list of extensions available for that version.
  2. Look for the mysqli or mysql extension in the list.
  3. Check the box next to the extension to enable it.
    • mysqli is the improved version of the original MySQL extension and is recommended for modern applications.
    • mysql is deprecated and not recommended for new applications, so focus on enabling mysqli.

Step 5: Save Changes

  1. After enabling the MySQL extension, click the Save button at the bottom of the page to apply the changes.
  2. You will receive a confirmation message indicating that your settings have been updated successfully.

Step 6: Verify the MySQL Extension

  1. To ensure that the MySQL extension is enabled, create a simple PHP file to check the PHP information.
  2. Use the File Manager in cPanel to create a new file named info.php in the root directory of your website.
  3. Open the file and add the following code:
    php
    <?php
    phpinfo();
    ?>
  4. Save the file and navigate to https://yourdomain.com/info.php in your web browser.
  5. Look for the mysqli section in the PHP info page. If you see it listed, the MySQL extension is successfully enabled.

Step 7: Remove the Info File

  1. After verifying that the MySQL extension is enabled, it’s a good security practice to delete the info.php file from your server to prevent unauthorized access to your PHP configuration details.

Conclusion

Enabling the MySQL extension in cPanel is a straightforward process that can significantly improve the performance of your web applications. By following the steps outlined in this guide, you can ensure that your applications have access to the MySQL database they require to function correctly.

If you have any issues during the process or need further assistance, feel free to contact our support team at StormHoster Support.


Related Articles

Post Your Comment

Build Your Website free with Stormhoster

From professional business to enterprise, we’ve got you covered!