Support » Installing WordPress » Your PHP installation appears to be missing the MySQL extension which is require

  • I launched an Amazon EC2 instance running Ubuntu 22.04. I installed apache2 and PHP 8.1 and MariaDB 10.6.11 and also installed php-mysql. I have noticed there is no mysql section on the output from phpinfo().

    In MariaDB I created a database called wp and a user called wpuser with all privileges. If I run SHOW GRANTS as wpuser one of the output lines is (bacticks converted to single quotes):

    GRANT ALL PRIVILEGES ON 'wp'.* TO 'wpuser'@'localhost'

    I have put the contents of WordPress directory (version 6.1.1) into /var/www/html. I created config.php and edited it to contain the DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. When I visit that page from a browser I get a web page with the message:

    Your PHP installation appears to be missing the MySQL extension which is require

    .

    It would be great to have some pointers as to what to do to troubleshoot this. I have been confused by the suggestions I have seen on google especially about whether php-mysql is necessary or not.

    • This topic was modified 3 weeks, 2 days ago by ace100.
    • This topic was modified 3 weeks, 2 days ago by ace100.
    • This topic was modified 3 weeks, 2 days ago by ace100.
    • This topic was modified 3 weeks, 2 days ago by ace100.
    • This topic was modified 3 weeks, 2 days ago by ace100.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Your problem is clearly spelt out in the error message: “Your PHP installation appears to be missing the MySQL extension”

    You’ve even confirmed that there’s no MySQL section in your phpinfo() output.

    So why are you bothering with MySQL databases and user privileges at all?

    You need to fix your PHP installation to add MySQL support.

    Note that installing the php-mysql extension may not necessarily enable it. So check your php.ini to be sure the extension is enabled.

    Also, confirm (depending on your distro and release) that php-mysql is even the correct name of the extension for PHP 8.1. On Ubuntu 20.04 LTS, the correct extension is php8.1-mysql.

    Thread Starter ace100

    (@ace100)

    Thanks, George, for your reply. It turns out I needed to restart Apache. Once I did that the mysqli extension and also references to PDO showed up when I ran phpinfo(). Also, the error message disappeared when I visited the site so I was able to continue with the install procedure.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.