1

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

guest9084390
  • 11
  • 1
  • 2

2 Answers2

2

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!

Konaras
  • 121
  • 1
0

@Konaras solution worked for me. thank you NB : move the whole /usr/lib64/apr-util-1/ so httpd will load database driver. with the following configuration for example :

   # mod_dbd configuration
# UPDATED to include authentication caching
DBDriver pgsql
DBDParams "dbname=apacheauth user=apache password=xxxxxx"

DBDMin  4
DBDKeep 8
DBDMax  20
DBDExptime 300

<Directory "/usr/www/myhost/private">
  # mod_authn_core and mod_auth_basic configuration
  # for mod_authn_dbd
  AuthType Basic
  AuthName "My Server"

  # To cache credentials, put socache ahead of dbd here
  AuthBasicProvider socache dbd

  # Also required for caching: tell the cache to cache dbd lookups!
  AuthnCacheProvideFor dbd
  AuthnCacheContext my-server

  # mod_authz_core configuration
  Require valid-user

  # mod_authn_dbd SQL query to authenticate a user
  AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s"
</Directory>
abk
  • 31
  • 2
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://serverfault.com/help/whats-reputation) you will be able to [comment on any post](https://serverfault.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/503365) – Dave M Nov 21 '21 at 17:17