Session file folder in PHP is not auto cleaned

Follow

Comments

4 comments

  • Avatar
    Robert Kühn

    How is the script called in Plesk 17? there is no such file in the cron.hourly!

  • Avatar
    Nick Plekhov

    Hello @Robert Kühn,

    The file mentioned in the article belongs to root's crontab.
    Please make sure that you are logged in as root or accessing the /etc/cron.hourly with sudo. Otherwise, you will see the crontab of the user you are logged in with.

  • Avatar
    Robert Kühn

    Thank you @Nick Plekhov,

    I just used the root user per ssh-console and even with sudo I can see only a ".placeholder" file inside. I just checked also the crontab with sudo and found only something like: /opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/xovi/scripts/clear-cache.php' ..

  • Avatar
    Nick Plekhov

    Hello @Robert Kühn
    In this case, I suggest you create the file manually.
    The content should be as follows:
    pgrep -f ".*$0$" | grep -qv $$ && exit 0

    renice 19 -p $$ >/dev/null 2>&1

    [ -x /usr/lib64/plesk-9.0/maxlifetime ] && [ -d /var/lib/php/session ] && /usr/lib64/plesk-9.0/php_session_cleaner /var/lib/php/session $(/usr/lib64/plesk-9.0/maxlifetime)

    After the file is created change the permissions as follows:
    chmod 755 /etc/cron.hourly/plesk-php-cleanuper

     

Please sign in to leave a comment.

Have more questions? Submit a request