[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
Continue reading “[Apache][MySQL] error_log: [crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available”

[MySQL] 解決MySQL server has gone away問題

下 SQL 語法對 MySQL server 做存取時 (縱使只是使用 use database1; 這樣的指令, 不一定要用到 SELECT 指令) 可能會遇到以下這個錯誤訊提示:

MySQL server has gone away

可以從以下幾個方向去看看是哪一類問題: Continue reading “[MySQL] 解決MySQL server has gone away問題”

[WEB][PHP] 關於網站線上人數統計的實做

[WEB][PHP] 關於網站線上人數統計的實做

如果網頁是使用 PHP 來寫的話,可以很容易做到基本的網站人數統計功能。

1. 去改寫 session 的處理方式,例如以下是將原本存到 file 的 session 資料變成存到 MySql 之類的 (memory) database. (註一):

去用 session_set_save_handler() 函式改寫 session 在

  • open(),
  • close(),
  • read(),
  • write(),
  • destroy(),
  • Gc()

時的處理方式。

其中: Continue reading “[WEB][PHP] 關於網站線上人數統計的實做”

安裝 PHP 時出現error: Cannot find MySQL header files under yes的錯誤訊息

[服務架設][系統]安裝 PHP 時出現error: Cannot find MySQL header files under yes的錯誤訊息

安裝 PHP 時,剛執行 ./configure –with-apxs2=/usr/local/Apache2/bin/apxs –with-mysql
就出現以下錯誤訊息:

…..
checking for mSQL support… no
checking for MSSQL support via FreeTDS… no
checking for MySQL support… yes
checking for specified location of the MySQL UNIX socket… no
checking for MySQL UNIX socket location… /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.

解法:

o 如果不知道 header file 在哪,用 「find / -name mysql.h」命令找出其位置;
o 如果是自己也有手動安裝 MySQL 套件的話,直接指定該位置。

在 ./configure 下參數指定 header file 的位置,如下:

./configure –with-apxs2=/usr/local/Apache2/bin/apxs –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config

這篇文章的關鍵字:
PHP install (PHP安裝), MySQL header files

將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?

[服務架設][系統]將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?

錯誤發生的原因是 4.1 版以後的密碼採用新的密碼驗證機制,如果用 myPhpAdmin 去新增出來的使用者,會採用新的機制給予密碼,舊的 mysql client 連進來要驗證密碼時就會出現上述錯誤。

解法:

將該要給舊 mysql client 用的帳號改成舊有的密碼機制,例如用新的 mysql 做以下動作:

$ mysql -h new_server_host -u root -p
mysql> SET PASSWORD FOR ‘some_user‘@’some_host‘ = OLD_PASSWORD(‘new_password‘);
mysql> FLUSH PRIVILEGES;

紅色標示的部分依照自身情況給值。

詳情請看這裡