CentOS / RHEL: Install MySQL PHP Extension

How do I install a module or extension for PHP applications that use MySQL databases under CentOS / Redhat / RHEL / Fedora Linux?

You need to install php-mysql module using the yum command which contains a dynamic shared object that will add MySQL database support to PHP. MySQL is an object-relational database management system. PHP is an HTML-embeddable scripting language. If you need MySQL support for PHP applications, you will need to install this package and the php package:
# yum install php php-mysql httpd

Finally, restart apache web server:
# service httpd restart

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.