Date Created: Wed 11-May-2011

Related Document Categories:

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


CentOS 5.5

Problem

Cannot load mysql extension please check your PHP configuration



I use CentOS as it is like RHEL without the branding and more akin to enterprise Linux implementations.

I have looked around the net and not found some simple answers in one place. So you’ve installed CentOS/PHPMyAdmin/PHP/MySQLmore than once you’ll know what is more than likely wrong, but you cannot remember how you did it.

The MySQL PHP module isn’t loaded. First of all, you must find your php.ini. It could be anywhere but if you create a small php file with the phpinfo(); command it will tell you where it is or you can use the following command line in CentOS.

find / -name php.ini

Typical result:

/etc/php.ini

rpm -ql php-mysql | grep mysql.so

Typical result (64 bit Linux)

/usr/lib64/php/modules/mysql.so


Other common places include /etc/, /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini

Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!

;extension=mysql.so

should become

extension=mysql.so

if it is missing simply add it.

Note:

php.ini should have a line like:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/lib64/php/modules"

if your mysql.so is located in /usr/lib64/php/modules/mysql.so

restart httpd

result

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


Steve Robinson - IBM Champion 2013

About Me

Steve Robinson has been working in IT for over 20 years and has provided solutions for many leading brands around the world. Steve specialises in JEE, DevOps and Thought Leadership.

In January 2013, I was awarded the prestigous 'IBM Champion' accolade.


  • Linked In
  • Twitter
  • About Me
  • Contact Me

Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

Courses

  • WebSphere Courses

Articles

WebSphere Categories

Other Categories