cyclestreets / cyclestreets/cyclestreets-setup

PHP configuration

Open
#26 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

apache
Dominant language
Shell
Stars
11
Forks
5
PR merge metrics
No merged PRs in 30d

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 9998f111848eed0fa090e3224abfdb82e981605c.

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the session.cookie_lifetime and session.gc_maxlifetime settings in an Apache virtualhost or higher-level conf-enabled file, then compare phpinfo() with the system php.ini files. Investigate whether the master values control the effective session behavior and whether zend.assertions has separate restrictions. Done means identifying the cause and documenting a reliable configuration method.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.