是的,您需要手动清理它们,因为您已经设置了自己的会话保存路径.您可以检查文件的年龄,并删除它是否超过x天/分钟,无论如何:
cd /path/to/sessions; find -cmin +24 | xargs rm
Run Code Online (Sandbox Code Playgroud)
摘自以下部分php.ini:
; 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
Run Code Online (Sandbox Code Playgroud)
请参阅此相关/重复的问题:清理php会话文件
"单一"命令:
find /path/to/session -name sess_* -cmin +24 -exec rm {} \;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4060 次 |
| 最近记录: |