Skip to content

PHP fails to run if positional parameters contain spaces #14

@mrcasual

Description

@mrcasual

Use case: docker run --rm alterway/php:7.4-cli "/path with spaces/to/phpunit.phar"

The command will fail due to word splitting that happens in entrypoint.sh when parameters are expanded:

[...]

if [[ ! -z "$1" ]]; then
    exec php ${*}
else
    exec php -h
fi

Changing php ${*} to php "${@}" fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions