PHP Session files are not automatically being cleaned and PHP.ini file cannot be updated

#1
I was unable to log into my WordPress admin due to PHP session files not being able to be created. After further investigation, the cause was that too many files were in the /tmp folder which blocked further files to be created in that directory (roughly 90,000 files). The first problem is that the session files are not being auto removed.

The second problem is that changes to the php.ini file do not take affect. I even removed the php.ini file and phpinfo() still reports that the original php.ini file is being loaded (even though it does not exist anymore) even after I reload lswsctrl and kill the lsphp processes.

The default session.save_path is set to "/tmp". Here is my session settings in my php.ini file (located at /usr/local/lsws/lsphp73/etc/php/7.3/litespeed/php.ini):

session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 60
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5

Any suggestions or comments are welcome!
 

Pong

Administrator
#2
It is a PHP question, not OLS question. Better split your different question into different thread.

For /tmp folder fill up issue, you can check what file filled up that folder.

For your php.ini issue, php detached mode should be restarted. "killall lsphp" should make it effective. If not, log a ticket we can check for you.
 
#3
Yes it is a PHP question but, should not OLS installation modify the php.ini to have temp files removed with some periodicity?
Otherwise this problem will happen to every user with inode limitation.
 
#4
session.gc_maxlifetime should works. If it's not, either switch the session folder, e.g. "tmp" to a bigger folder, or create a session clean-up script to handle cleaning up the session files every few minutes.
 
Top