Open waterloo3122 opened 5 years ago
mkdir /tmp/phpsession
vim /usr/local/php/etc/php.ini 找到下面这行,并记住5这个数字 session.hash_bits_per_character = 5
将这一行对应的内容改为 session.save_path = "2;/tmp/phpsession/"
wget https://raw.githubusercontent.com/php/php-src/master/ext/session/mod_files.sh bash mod_files.sh /tmp/phpsession 2 5
chown -R bae.bae /tmp/phpsession
/etc/init.d/php-fpm restart
check this article
https://serverfault.com/questions/890897/php-sessions-directory-keeps-filling-until-overflowing
默认的php配置在运行phpmyadmin的时候,会在/tmp目录下,建立大量的sess_开头的文件, 导致/tmp目录在执行ls的命令时响应很慢。