-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Difficult directives
Despite being listed as PHP_INI_ALL the following directives are not effectively assigned to values applied from the Apache configuration:
| Directive | Changeable |
|---|---|
| session.gc_maxlifetime | PHP_INI_ALL |
| session.cookie_lifetime | PHP_INI_ALL |
| zend.assertions | PHP_INI_ALL with restrictions |
The assigned values are respected when included in the php.ini system, as has been tried for example in 9998f11.
The zend.assertions directive controls how PHP is compiled which might be why it has to be set in the php.ini system, and the qualification with restrictions is a hint to that.
phpinfo()
Despite looking at this many times over the last decade I have never gotten to the bottom of why the other two settings cannot be set reliably from the Apache configuration. E.g. when set in the either a virtualhost configuration or the one of the higher level conf-enabled files to 86400, phpinfo() lists them as:
| Directive | Local value | Master value |
|---|---|---|
| session.cookie_lifetime | 86400 | 1440 |
| session.gc_maxlifetime | 86400 | 1440 |
(1440 = 24 minutes, 86400 = 24 hours)
but the setting in force appears to be the master value as about 24 minutes later the site requests a login. (This wait also makes it a pain to test / debug.)
I think it might be something to do with the server wide nature of these settings - e.g. the garbage collection lifetime presumably applies to the whole of php as perhaps hinted at by the note attached to this documentation for the session.gc_maxlifetime directive.
Consequence
Until this matter can be resolved then changing these values from their defaults requires edits in the php.ini system files.