I tried to install wordpress but when I browse to the webpage I get:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I launched an Amazon EC2 instance with ubuntu 22.04. Then I installed apache2, php 8.1, MariaDB 10.6.11 and php8.1-mysql. I unzipped wordpress 6.1.1 into the root directory (/var/www/html).
I created config.php and edited it to contain the DB_NAME (wp), DB_USER (wpuser), DB_PASSWORD and DB_HOST (localhost). When 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'
When I run
phpinfo() from the site I can not see a section headed "MySQL" which seems wrong to me although I have seen some information suggesting the MySQL PHP extension is not required for modern versions of PHP and Wordpress.
I thought I might need a php-mysqli extension so I tried to install that but got the following output:
/var/www/html$ sudo apt-get install -y php-mysqli
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'php8.1-mysql' instead of 'php-mysqli'
php8.1-mysql is already the newest version (8.1.2-1ubuntu2.9).
php8.1-mysql set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
I have run out of ideas for troubleshooting this issue and would be grateful for some help.