Skip to content

load php.ini at startup - #60

Merged
nvms merged 1 commit into
mainfrom
php-ini
Sep 10, 2026
Merged

load php.ini at startup#60
nvms merged 1 commit into
mainfrom
php-ini

Conversation

@nvms

@nvms nvms commented Sep 10, 2026

Copy link
Copy Markdown
Owner

zphp now reads a php.ini file: --ini=PATH, then the ZPHP_INI environment variable, then php.ini in the working directory. -d name=value overrides a directive from the command line the way php -d does. Values follow the php.ini rules for quotes, On/Off, ${VAR} expansion, and E_* expressions such as E_ALL & ~E_DEPRECATED.

The file is read once into a process-lifetime list and applied at the start of every request beneath the ini_set layer, so a request under zphp serve never inherits another request's ini_set or date_default_timezone_set. date.timezone, error_reporting, and max_execution_time take effect in the VM, ini_restore returns to the file's value, and php_ini_loaded_file reports what was read. extension= lines load extensions through the same loader as --extension, by path or by name inside extension_dir.

tests/ini_test covers the three discovery paths, -d, value cooking, the live mirrors, request isolation under serve, and both extension= forms; it runs in the extensions CI job.

@nvms
nvms merged commit cfc7bd3 into main Sep 10, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant