Install php-mysql extension centos 7

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!

asked Aug 11, 2020 at 17:05

1

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>

Install php-mysql extension centos 7

restart your apache service, and you should be OK.

answered Nov 17, 2020 at 19:24

Install php-mysql extension centos 7

1

Alright... finally, so it turns out all I needed to do was restart PHP-FastCGI. Yay.

systemctl restart php-fastcgi.service

answered Jan 4, 2016 at 1:47

Sayem KhanSayem Khan

2391 gold badge3 silver badges8 bronze badges

1

Modern PHP applications use the mysqli extension which supersedes the insecure (and now deprecated) mysql extension. This should be enabled by default when you install the php-mysql package but you can check it by running:

$ cat /etc/php.d/mysqli.ini

; Enable mysqli extension module
extension=mysqli.so

To be sure that this module is enabled, check that this module is listed in the PHP info page that you showed a sample of. Note that it’s listed further down the page in the modules section.

If you have the PHP command line interface installed (from the php-cli package) you can easily check by running php -i | grep -i mysqli. This should include the following line:

MysqlI Support => enabled

answered Jan 3, 2016 at 17:26

3

Install php-mysql extension centos 7
I believe most users who try to install WordPress on a Linux server encountered this problem. This problem occurs if Apache, PHP and MySQL server has been installed but without or missing the MySQL extension. Follow the steps below to resolve this issue :

Problem :
I’m installing WordPress blog system under CentOS Linux or RHEL and getting an error which read as follows:

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

What is PHP

PHP is the most popular scripting language for web development. It is free, open source and server-side (the code is executed on the server).

What is MySQL

MySQL is a Relational Database Management System (RDBMS) that uses Structured Query Language (SQL).

MySQL module for php5

PHP support for MySQL should work without a problem if installed properly.

Solution for missing the MySQL extension :

1. Login to your linux server as a root and install the most important php extension to work with MySQL server features :

[root@server ~]# yum install php-mysql -y

2. Once you installed above php-mysql extension, kindly restart your apache web server.

etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]