4

I was trying to install WordPress on my CentOS 8 server today when I received this error:

"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."

I understand that this extension has been removed in PHP 7 and above.

I've tried both of the following:

  sudo yum update
  sudo yum install php70w-mysql
  sudo yum install php-mysql

However, I receive the following message:

 No match for argument: php70w-mysql
 Error: Unable to find a match: php70w-mysql

or

   No match for argument: php-mysql
   Error: Unable to find a match: php-mysql

Please let me know how I can get this MySQL extension installed.

Thanks for your help!

arkitektron
  • 81
  • 1
  • 1
  • 7
  • 1
    Yes, the old `mysql` extension has been deprecated since PHP 5.5 and removed in PHP 7. You probably want `php-mysqlnd` installed. – Markus AO Aug 11 '20 at 17:47

1 Answers1

10

as far as i know, php-mysql does not longer apply for centos8-PHP 7 and more, try this, it should update your PHP installation and enable you to use mysql commands>

yum install php-mysqlnd

do the normal installation process (y) and then, you can test with:

php -m

and check among the enabled modules/extensions, for the ones that start with mysql, you should have at least these two>

enter image description here

restart your apache service, and you should be OK.

Pablo Contreras
  • 558
  • 6
  • 11
  • This also helped on "DB Error: extension not found" problem I was facing, as I am working on a legacy PHP app, on a new system with php 7.2, and due to missing mysqli/mysqlnd modules, I got this error. – JureW Dec 20 '21 at 07:51