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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop















{ 3 comments… read them below or add one }
Hi,
Can you help me to resolve php-mysql extension configuration problem?
I had RHL enterprise 5 installed on my server and found that the PHP installed has
no php-mysql support from phpinfo().
I tried your suggested instruction of :
yum install php php-mysql httpd
and got the following response? What do I have to do to resolve this?
[root@rhl-server ~]# yum install php php-mysql httpd
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Nothing to do
Thanks for any info
Jeff
My web hosting tech support could not solve this issue. So, thanks for posting the how to. You saved me many hours of work. Glad I finally found this in Google.
Dave
I hv installed this, and I got this message when I tried to install wordpress,
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
How can I fix it ?
thanks