Knowledgebase

The pdo_mysql extension is missing on alt-php81

If the pdo_mysql extension is missing for PHP 8.1 in your Alt-PHP environment, you'll need to install it manually. Here's a step-by-step guide:

  1. Check Available Extensions:

    • Verify if pdo_mysql is available for PHP 8.1 in your Alt-PHP repository. Sometimes, certain repositories or environments might not have all extensions readily available.
  2. Enable Repositories (If Necessary):

    • Make sure you have the appropriate repositories enabled in your package manager. This might involve adding additional repositories that provide the pdo_mysql extension.
  3. Install pdo_mysql Extension:

    bash

 

  • sudo yum install alt-php81-pdo_mysql

    If you're using a different package manager (e.g., apt for Debian-based systems), you would use the appropriate command for that package manager.

  • Restart PHP and Web Server:

    bash
  • sudo service alt-php81-fpm restart

    Make sure to replace alt-php81-fpm with the actual PHP-FPM service name for PHP 8.1 in your Alt-PHP environment.

  • Verify Installation:

    Create a PHP file (e.g., phpinfo.php) with the following content:

    php
  • <?php phpinfo(); ?>

    Upload this file to your server and access it through a web browser. Look for the pdo_mysql section to confirm that it's now enabled.

  • Update php.ini (Optional):

    • Depending on your setup, you might need to add or uncomment the following line in your php.ini file:

      makefile

 

    • extension=pdo_mysql.so

    Make sure the php.ini file is for PHP 8.1.

  1. Check for Conflicting Extensions:

    • Ensure there are no conflicting extensions or configurations that might be causing pdo_mysql to be disabled.
  2. Contact Support (If Necessary):

    • If you're unable to install the extension or encounter any issues, consider reaching out to your hosting provider's support team for assistance.

Please note that the specific steps and package names might vary depending on your hosting environment and package manager. If you're unsure about any step, consider consulting with your hosting provider or a qualified professional for guidance.

 
  • 0 Users Found This Useful
Was this answer helpful?