Teadmistebaas
The clean_user_php_sessions Script Prindi artikkel
Overview:
Use the /usr/local/cpanel/scripts/clean_user_php_sessions
script to purge expired PHP sessions from a secure temporary directory. This script checks the session.gc_maxlifetime
and session.save_path
variables in the global php.ini
file and determines when to remove the PHP session files.
- This script only recognizes the global
session.gc_maxlifetime
PHP configuration value for each version of PHP. - If this script detects different values in the
session.gc_maxlifetime
variable, but the system stores the session data in a single location, the script uses the minimum value to determine when to purge expired session files.
For more information about PHP session files, read our MultiPHP INI Editor for WHM documentation.
- This script requires
root
-level permission. - We recommend that this script runs at least once per day to remove old PHP session files.
- When the
/usr/local/cpanel/scripts/maintenance
script runs, it adds the/usr/local/cpanel/scripts/clean_user_php_sessions
script to the root user’s crontab. - If you customize the
session.gc_maxlifetime
value, but do not customize thesession.save_path
value, the script does not use thesession.gc_maxlifetime
variable value.
Run the script
When you run this script, the system only removes files with the session.save_path
variable in a sess_*
format by default.
Arguments
This script accepts the following arguments:
Option | Description | Example |
---|---|---|
A valid Perl Compatible Regular Expression (PCRE). | A PCRE to match custom PHP session filenames. | /usr/local/cpanel/scripts/clean_user_php_sessions '^ci_session[[:alnum:]]\{40}$' |
Example
To clear out all PHP session files that match the custom example_session_*
format, run the following command:
/usr/local/cpanel/scripts/clean_user_php_sessions '^ci_session[[:alnum:]]{40}$'
Make certain the provided regular expression is specific so you do not remove any misconfigured session.save_path
variables.
Kas see vastus oli kasulik?
Seotud artiklid
Overview: The cPanel & WHM installation process adds important scripts to your server’s...
Overview: You can use the /usr/local/cpanel/bin/dbmaptool script to grant ownership of databases...
Overview: This script allows you to manage the task queue system. The task queue system allows...
Overview: The /usr/local/cpanel/scripts/auto-adjust-mysql-limits script updates MySQL®...
Overview: The /usr/local/cpanel/bin/autossl_check script allows you to manually check the SSL...