fix session expiration & crashed mysql tables of php sites
Wednesday, August 18, 2010 1:52:12 PM
Q1: 有些PC用IE打開phpBB時,出現以下錯誤訊息,但有些不會: Critical Error...sessions_keys' is marked as crashed and should be repaired.
A1: 這是資料庫的一個管理登入階段(sessions)的表格錯誤所致,需要PC瀏覽器清掉瀏覽歷程。解決方法為:用IE->[工 具]->[網際網路選項]->[瀏覽歷程紀錄],把能清掉的暫存檔、cookies等等,全都清掉。這樣就可以正常打開新聞BBS了。
##. How to repair table
1. backup database
2. under mysql prompt
check table the_crashed_table (to see if it is really corrupted)
repair table the_crashed_table (if needed)
Make sure there is no db access first before you do it. After that restart
mysql and check log to see if the table is repaired.
## 若沒有特別修改 php.ini, 通常 session 過期時間是 1440 秒(24分鐘)
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440
; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script would is the equivalent of
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; cd /path/to/sessions; find -cmin +24 | xargs rm
A1: 這是資料庫的一個管理登入階段(sessions)的表格錯誤所致,需要PC瀏覽器清掉瀏覽歷程。解決方法為:用IE->[工 具]->[網際網路選項]->[瀏覽歷程紀錄],把能清掉的暫存檔、cookies等等,全都清掉。這樣就可以正常打開新聞BBS了。
##. How to repair table
1. backup database
2. under mysql prompt
check table the_crashed_table (to see if it is really corrupted)
repair table the_crashed_table (if needed)
Make sure there is no db access first before you do it. After that restart
mysql and check log to see if the table is repaired.
## 若沒有特別修改 php.ini, 通常 session 過期時間是 1440 秒(24分鐘)
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440
; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script would is the equivalent of
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; cd /path/to/sessions; find -cmin +24 | xargs rm






