[Apache][MySQL] error_log: [crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available

在 apache web server 的 …/apache/logs/error_log 檔案如果很大,並且一直重複看到以下錯誤訊息:

[crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available

錯誤原因:
因為安裝 Apache 時預設以下兩個 modules 是開啟的:
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule dbd_module modules/mod_dbd.so

如果 dbd-mysql package 沒有安裝,則在 MySQL 使用 dbd 相關函式時就會產生上面的錯誤訊息而被 apache 記錄到 error_log 檔案中。

如果確定不會用到 DBD 機制的話,解決方法可以是修改 …/apache/conf/httpd.conf 檔案:
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule dbd_module modules/mod_dbd.so

也就是將上面這兩個 modules 註解掉不使用,然後重跑 apache server:
…/bin/apachectl stop ; …/bin/apachectl start

這樣 error_log 檔案中就不會再出現上面的錯誤資訊了。

說明:
以上停用 dbd 相關的 modules 並不會影響到 PHP 去存取 MySQL 的資料庫,相關的資料庫存取行為應該都還是能正常運作。

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.