简体   繁体   中英

How do I install the MySQL extension for PHP 7 on CentOS 8?

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!

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>

在此处输入图像描述

restart your apache service, and you should be OK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM