-
-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Labels
Description
Summary
The auto_configure.ini opcache configuration file is created but never applied in several Docker versions because -c is passed to the PHP script instead of the PHP interpreter.
Current behavior
7.0.3, 7.0.4, 8.0.0, flex pass -c to the script:
php auto_configure.php -c auto_configure.ini -f ${CONFIGURATION}The -c flag ends up as a bogus key in $installSettings['-c'] = '' and the opcache settings are ignored.
8.0.1, binary correctly pass -c to PHP:
php -c auto_configure.ini auto_configure.php "${config_args[@]}"Additional inconsistency
There are three different argument-passing styles:
| Versions | Style | Notes |
|---|---|---|
| 7.0.3, 7.0.4, 8.0.0 | -f ${CONFIGURATION} |
Unquoted, relies on word-splitting |
| flex | -f "${CONFIGURATION}" |
Quoted, uses -f correctly |
| 8.0.1, binary | "${config_args[@]}" |
Array expansion, no -f flag |
Suggested fix
Standardize all versions on the 8.0.1/binary pattern:
read -r -a config_args <<< "${CONFIGURATION}"
php -c auto_configure.ini auto_configure.php "${config_args[@]}"Or, with #561 merged (adds -f support):
php -c auto_configure.ini auto_configure.php -f "${CONFIGURATION}"Either approach correctly passes -c to PHP and handles the configuration string safely.
Related
- fix(docker): add -f flag support to auto_configure.php #561 adds
-fflag support to auto_configure.php in 7.0.4, 8.0.0, 8.0.1, binary
Reactions are currently unavailable