session garbage collector does not read conf.d

Bug #1445919 reported by Alex
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
New
Undecided
Unassigned

Bug Description

The cron job in `/etc/cron.d/php5` is executing the command line php and calls `ini_get_all("session")` then reads the value of `session.gc_maxlifetime`.

However, that does not capture any options set in `/etc/php5/apache2/conf.d` which is read by the apache2 mod-php5, nor any of the SAPIs' conf.d dirs in `/etc/php5/*/conf.d`.

So the script does not see what the actual production PHP sees ...

The actual problem is that all sane admins do not modify `/etc/php5/apache2/php.ini` directly but instead add an .ini file in the `conf.d` directory with our customized settings for them to persist across upgrades, otherwise it's a hassle everytime there is a PHP upgrade. That was the whole point of the `conf.d` directory ...

The `/etc/cron.d/php5` script should also load the .ini files in `conf.d` dir. That's where I set my `session.gc_maxlifetime`, which is now ignored and my sessions are killed early ...

The simplest fix is to prepend `PHP_INI_SCAN_DIR="/etc/php5/${conf_dir}/conf.d"` to the php command:

`PHP_INI_SCAN_DIR="/etc/php5/${conf_dir}/conf.d" php5 -c /etc/php5/${conf_dir}/php.ini -d .......`

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.