Mysql – DBD: Can’t load driver file apr_dbd_thesql.so

apache-2.2databasedriversMySQLserver-side-includes

I am using Apache 2 on a virtual machine running a LAMP stack (mysql version 5.6). When I try to restart the server I am getting this error;

DBD: Can't load driver file apr_dbd_mysql.so

I have made sure that the apr_dbd_mysql.so file is inside the apache modules directory (../apache2/modules/). However that is not fixing the problem.

Wondering is there anyway I can load it up through httpd.conf ? if so which is the way to load it up?

Can someone help me fix this bug ?

Thanks

Best Answer

I have spent almost two weeks on the same problem pulling my hair out of despair until I found the following solution which worked for me. As I have leared myself there could be many reasons for this problem so the solution is for only one of those. Try the following:

When you installed apr_dbd_mysl package it should have created a shared objects (apr_dbd_mysql-1.so, apr_dbd_mysql.so) in /usr/lib64/apr-util-1/. I guess you, have been told to copy them to ...apache2/modules, which did not work for me either. What did work, however, is copying the whole apr-util-1 directory with the objects inside to /usr/local/apache2/lib.

So at the end you have:

ls /usr/local/apache2/lib/apr-util-1/ apr_dbd_mysql-1.so apr_dbd_mysql.so

Hope it works!