µ±Ò»¸oĿ¼ÏÂÓкܶaÎļþʱ£¬þÎñÆ÷µÄ´¦ÀiÐÔÄÜ»a±aµÍ£¬phpĬÈϵÄsession½o½o´aeÅÔÚ/tmpĿ¼Ï£¬Î´½øÐÐÖ¼¶£¬µ±ÓÐÒ»¶¨µÄÃÎÊÁ¿Ê±£¬¾Í´aeÔÚÐÔÄÜÎÊÌaÁË¡£
Ê×ÏÈ£¬ÐÞ¸Ä php.iniµÄ session.save_path Ñ¡ÏiÐÞ¸ÄÈçÏ£º
session.save_path = ¡°2;/tmp/session¡± £¨È¥µoÇ°Ãaeֺţ(C)
±iʾ°Ñsession´aeÅÔÚ ¡°/tmp/session¡± Ŀ¼Ï£¬²¢ÇÒ*Ö³É 2 ¼¶×ÓĿ¼
Ò»°aÇe¿oÏÂ2¼¶Ä¿Â¼¾Í¹»ÁË£¬¾ÍÄܹ»´¦ÀiÏaµ±´oµÄ*ÃÎÊÁ¿ÁË
¡ª¡ª¡ª¡ª¡ª¡ª¡ª¨C
ÆaËu×¢ÊÍ
session.hash_function = 0
; Éu³ÉSIDµÄÉ¢ÁÐËa*¨¡£SHA-1µÄ°²È«ÐÔ¸u¸ßÒ»Ð(C)
; 0: MD5 (128 bits)
; 1: SHA-1 (160 bits)
; ½¨ÒeʹÓÃSHA-1¡£
session.hash_bits_per_character = 4
; Ö¸¶¨ÔÚSID×Öu´®ÖеÄÿ¸o×ÖuÄÚ±£´ae¶aÉÙbit£¬
; ÕaÐ(C)¶þ½øÖÆÊýÊÇhashº¯ÊýµÄÔËËa½a¹u¡£
; 4: 0-9, a-f
; 5: 0-9, a-v
; 6: 0-9, a-z, A-Z, ¡°-¡°, ¡°,¡±
; ½¨ÒeֵΪ 5
¡ª¡ª¡ª¡ª¡ª¡ª¡ª¡ª¨C
phpÔ´ÂeÎļþÖÐext/session/mod_files.shÎļþ£¬¿ÉÒÔ¸¨ÖuÉu³ÉĿ¼£¬¾Í²»ÓÃ×Ô¼ºÔÚд½Å±¾ÁË
#! /bin/sh
if test "$2" = ""; then
echo "usage: $0 basedir depth"
exit 1
fi
if test "$2" = "0"; then
exit 0
fi
hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
if test "$3" -a "$3" -ge "5"; then
hash_chars="$hash_chars g h i j k l m n o p q r s t u v"
if test "$3" -eq "6"; then
hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ,"
fi
fi
for i in $hash_chars; do
newpath="$1/$i"
mkdir $newpath || exit 1
sh $0 $newpath `expr $2 - 1` $3
done
ÉeÖÃΪ¿ÉÖ´ÐÐÖ®ºo£¬ÔËÐÐÒÔÏÂÃuÁiÀ´´´½¨¹þϣĿ¼£º
Èý¸o²ÎÊýÒÀ´Î±iʾ£¬´aež¶£¬ ¼¸¼¶Ä¿Â¼£¬Ã¿¸oĿ¼Éu³É¶aÉÙ¸oĿ¼£¨²Î¿¼session.hash_bits_per_character£(C)
ÁiÍaÐeҪעÒaÐÞ¸Ä /tmp/sessionµÄȨÏÞ£¬±£Ö¤ÔËÐÐphpµÄÕʺÅÓÐȨÏÞ¶Áд
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8