Symfony calls the PHP garbage collector on Ubuntu 14.04 even when session.gc_probability is set to 0

I found it, I guess the latest version of symfony is overwriting this by default when using the app_dev.php. The Symfony FrameworkBundle is setting the session.gc_probability = 1.

As of Symfony 3

However, some operating systems do their own session handling and set the session.gc_probability variable to 0 to stop PHP doing garbage collection. That’s why Symfony now overwrites this value to 1.

If you wish to use the original value set in your php.ini, add the following configuration:

# config.yml
framework:
    session:
        gc_probability: null

https://symfony.com/doc/current/components/http_foundation/session_configuration.html#configuring-garbage-collection

Previous 2.x versions

To change this add the following to your config.yml

framework:
    session:
        gc_probability: 0

Then clear the dev cache

php app/console cache:clear

This is where it shows the gc_probability defaulted to 1. Why they dont just read from the php.ini settings im not sure.

http://symfony.com/doc/2.5/reference/configuration/framework.html#gc-probability

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)