dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.16k stars 193 forks source link

invalid interpolation format for services.php.environment.TRUSTED_HOSTS. #792

Closed toutvukantabu closed 2 weeks ago

toutvukantabu commented 2 weeks ago

What happened?

Hy, i have an issue when trying to build the project for the first time. I get the following error:

invalid interpolation format for services.php.environment.MERCURE_PUBLIC_URL.
You may need to escape any $ with another $.
https://${SERVER_NAME:-localhost

Environment:

Steps to Reproduce:

  1. Clone the repository.
  2. Run docker compose build --no-cache.

Expected Result:

The project should build without any errors.

Actual Result:

The build fails with the following error message:

invalid interpolation format for services.php.environment.MERCURE_PUBLIC_URL.
You may need to escape any $ with another $.
https://${SERVER_NAME:-localhost

Temporary Fix:

To fix the issue, I modified a line in the docker-compose.yaml file:

Old:

TRUSTED_HOSTS: ${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|localhost}|php$$}

New:

TRUSTED_HOSTS: ${TRUSTED_HOSTS:-^$${SERVER_NAME:-example\.com|localhost}|php$$}

Question:

Is this a global issue or just limited to a certain configuration?

Build Type

Official static build

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

none

Relevant log output

No response

dunglas commented 2 weeks ago

It's unrelated to FrankenPHP, upgrading Docker Compose will fix the issue: https://github.com/dunglas/symfony-docker/issues/616