Skip to content

fix(docker): opcache config not applied in auto_configure invocations #562

@kojiromike

Description

@kojiromike

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions