Skip to content

[BUGFIX] Let docker-php-setting change a setting - #627

Merged
Kanti merged 1 commit into
webdevops:masterfrom
andersundsehr:bugfix/docker-php-setting
Nov 17, 2026
Merged

Kanti merged 1 commit into
webdevops:masterfrom
andersundsehr:bugfix/docker-php-setting

Conversation

@Kanti

@Kanti Kanti commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

docker-php-setting printed its usage text and exited with 1 on every valid call, for example docker-php-setting memory_limit 512M. It required more than two arguments ($# -le 2), and its loop over the arguments shifted the first one away, whatever it was. It now takes an optional --raw first, then the setting and its value.

Related issue: #269 (RUN docker-php-setting short_open_tag On fails with the usage text), closed in 2018 without a fix.

Changes

  • provisioning/php/general/bin/usr-bin/docker-php-setting: --raw only as the first argument, at least two arguments; make generate.
  • Image test testDockerPhpSettingChangesASetting in PhpChecks. In a container with PHP_MEMORY_LIMIT=256M, it runs docker-php-setting memory_limit 384M and docker-php-setting --raw error_reporting E_ERROR. It expects 384M and 1 from the CLI, and memory_limit => 384M from php-fpm -i.
  • Docs:
    • docs/customization.md lists the command under "Tools for your Dockerfile", with both examples from the test, and says at php.ini that the command appends to that file.
    • The known issue is removed.

How it was verified

The commands of the new test, in a container with PHP_MEMORY_LIMIT=256M:

Image Published image With the new script
php:8.5 exit code 1 (usage text) 384M 1 and memory_limit => 384M => 384M, exit code 0
php:8.5-alpine exit code 1 (usage text) the same

"With the new script" is the published image with the script of this pull request mounted over /usr/local/bin/docker-php-setting. The setting wins over PHP_MEMORY_LIMIT, because php.ini is loaded as 99-docker.ini after 98-webdevops.ini. Also checked there: one argument and --raw alone print the usage text and exit with 1; date.timezone Europe/Berlin is written as "Europe/Berlin", max_execution_time 120 without quotes.

Rebased on master with #625 and #626; ci/console generate changes nothing. The CI run of this pull request runs the new test in every PHP image, on amd64 and arm64.

docker-php-setting printed its usage text and exited with 1 for every
valid call, because it required more than two arguments, and its loop
over the arguments shifted the first one away whatever it was. It now
takes an optional --raw first, then the setting and its value.

A new image test sets memory_limit and error_reporting with it, also
against PHP_MEMORY_LIMIT, and reads them from PHP and PHP-FPM. The
command is documented under "Tools for your Dockerfile", and its known
issue is removed.
@sonarqubecloud

Copy link
Copy Markdown

@Kanti
Kanti marked this pull request as ready for review November 17, 2026 06:56
@Kanti
Kanti merged commit 06c070b into webdevops:master Nov 17, 2026
180 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