diff --git a/docs/config.md b/docs/config.md index 5abbea36..4b1bee0e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -6,15 +6,16 @@ In the Docker image, the `Caddyfile` is located at `/etc/caddy/Caddyfile`. You can also configure PHP using `php.ini` as usual. -In the Docker image, the `php.ini` file is not present, you can create it or `COPY` manually. - -If you copy `php.ini` from `$PHP_INI_DIR/php.ini-production` or `$PHP_INI_DIR/php.ini-development`, you also must set the variable `variables_order = "EGPCS"`, because the default value for `variables_order` is `"EGPCS"`, but in `php.ini-production` and `php.ini-development` we have `"GPCS"`. And in this case, `worker` does not work properly. +In the Docker image, the `php.ini` file is not present, you can create it or `COPY` manually: ```dockerfile FROM dunglas/frankenphp -RUN cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini; \ - sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' $PHP_INI_DIR/php.ini; +# Developement: +RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini + +# Or production: +RUN cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini ``` ## Caddyfile Config diff --git a/frankenphp.c b/frankenphp.c index 562cd0ef..5a2aba00 100644 --- a/frankenphp.c +++ b/frankenphp.c @@ -675,6 +675,11 @@ static void frankenphp_register_variables(zval *track_vars_array) { /* https://www.php.net/manual/en/reserved.variables.server.php */ frankenphp_server_context *ctx = SG(server_context); + /* In CGI mode, we consider the environment to be a part of the server + * variables + */ + php_import_environment_variables(track_vars_array); + go_register_variables(ctx->current_request ? ctx->current_request : ctx->main_request, track_vars_array);