1

I'm having a issue, just in Debian based distros, since at CentOS 6.6 it does not happen, and I don't know how to get rid of this other than set the property gc_probability to 0 which leads me to another issue. This is how my configuration looks at config.yml:

framework:
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
        cookie_lifetime: 86400
        gc_maxlifetime: 600 # session will expire after 10 minutes of inactivity  
        gc_probability: 1
        gc_divisor: 1

That configuration in CentOS works perfectly as I said before but in Debian it fails with the following error:

Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)

Why? What is the cause of this?

Doing a research I found here that disabling the value will makes the error goes out but then if I disabled that one the session never expires and the page could be opened for hours (I leave it open a complete night and the day after when I hit F5 surprise the same session with same values still open which is a security hole)

Any advice around this? Solutions? Clues?

Community
  • 1
  • 1
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
  • No permissions for the webserver(?) user to /var/lib/php5, this is obvious. open_basedir active or using fastcgi? – Emii Khaos Jan 25 '15 at 15:51
  • @Paziツ why the webserver should have access to `/var/lib/php5`? Anyway that directory doesn't exists under CentOS, where is it? `open_basedir` is commented (; semicolon) in `/etc/php5/apache2/php.ini` so I think is off, and not, not using `fastcgi` – ReynierPM Jan 25 '15 at 16:28
  • The `session.save_path` is by default `/var/lib/php5` in debian based distros. – Emii Khaos Jan 25 '15 at 22:38
  • 2
    possible dupe of http://stackoverflow.com/questions/25454675/symfony-calls-the-php-garbage-collector-on-ubuntu-14-04-even-when-session-gc-pro – Phil Thomas Feb 06 '15 at 10:15
  • Possible duplicate of [Symfony calls the PHP garbage collector on Ubuntu 14.04 even when session.gc\_probability is set to 0](https://stackoverflow.com/questions/25454675/symfony-calls-the-php-garbage-collector-on-ubuntu-14-04-even-when-session-gc-pro) – Yes Barry Nov 20 '18 at 18:52

0 Answers0