[Bug 1445919] [NEW] session garbage collector does not read conf.d

Alex normadize at gmail.com
Sun Apr 19 13:24:42 UTC 2015


Public bug reported:

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 .......`

** Affects: php5 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in Ubuntu.
https://bugs.launchpad.net/bugs/1445919

Title:
  session garbage collector does not read conf.d

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1445919/+subscriptions



More information about the Ubuntu-server-bugs mailing list