shinsenter / php

📦 Simplified PHP Docker images for effortless customization and extension setup. Our Docker images cover PHP versions from 5.6 to 8.4, available in CLI, ZTS, FPM, FPM/Apache2, FPM/Nginx, RoadRunner, FrankenPHP, and Nginx Unit variants, for both Debian and Alpine versions. Updated everyday.
https://hub.docker.com/r/shinsenter/php
GNU General Public License v3.0
161 stars 26 forks source link

PHP: syntax error, unexpected '=' in /usr/local/etc/php/conf.d/zz-generated-settings.ini #157

Open Thijmen opened 1 month ago

Thijmen commented 1 month ago

Hi there,

After not having to build an image with shinsenter/php:8.2-fpm-apache, I built one today and resulted in the following error when running PHP;

php -v
PHP:  syntax error, unexpected '=' in /usr/local/etc/php/conf.d/zz-generated-settings.ini on line 23
PHP 8.2.24 (cli) (built: Sep 27 2024 06:51:37) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.24, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.24, Copyright (c), by Zend Technologies

The file looks like this:

[PHP]
allow_url_include = 0
date.timezone = Europe/Amsterdam
display_errors = 0
error_log = /proc/1/fd/2
expose_php = 0
mail.log = /proc/1/fd/2
max_execution_time = 240
memory_limit = 1024M
opcache.enable = 1
opcache.error_log = /proc/1/fd/2
opcache.jit_debug = 0
opcache.max_accelerated_files = 130987
opcache.preload_user = www-data
post_max_size = 600M
report_zend_debug = 0
request_order = GP
session.cookie_httponly = 1
session.cookie_lifetime = 0
session.cookie_samesite = Lax
session.cookie_secure = 0
session.save_handler = redis
session.save_path = tcp://some-secret-value:6379?auth=someauth
session.use_cookies = 1
syslog.facility = syslog
upload_max_filesize = 100M
variables_order = EGPCS

; Generated at 2024-10-09 15:55:35

Seems to be related to this file: https://github.com/shinsenter/php/blob/main/src/php/common/shell-php/php-envvars#L44C18-L44C25

It looks like it seems not to be that happy with the double = on like with session.save_path. What is a better way to handle this?

Thijmen commented 1 month ago

By the way, running php-envvars does show it correctly:

PHP_SESSION_SAVE_PATH='tcp://some-secret-value:6379?auth=someauth'
shinsenter commented 1 month ago

@Thijmen

Thank you for the feedback regarding this issue.

I'm not sure if I can test and fix it soon, but I'd like you to try setting the environment variable ALLOW_RUNTIME_PHP_ENVVARS=1 for your container to see if it might temporarily resolve the issue for you.

Best regards

Thijmen commented 1 month ago

Indeed, it looks like that works for now! Thanks

shinsenter commented 1 month ago

I am glad hearing it’s working