I try to empty a folder (/var/lib/php/session/) with putty on ssh, but I does not work. I do not know what goes wrong.
This is the command I use:
rm -rf /var/lib/php/session/*
Every time I run this command, it hangs without returning. Thanks
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Probably some of those files are still in use by a running PHP process. You can use
lsof -f to verify this.
Are (another assumption since you're not providing many details) you running a webserver (Apache, nginx, etc) from which the PHP scripts are served? In that case you can stop the webserver, try running your command again and then start the webserver again, but keep in mind that this wil break visitors' websessions since you're removing all session data.