Open jessedobbelaere opened 2 months ago
Currently worked around using:
RUN mv /etc/php.d/60-craftcms.ini /etc/php/8.3/fpm/conf.d/60-craftcms.ini && \
sed -i '/^php_admin_value\[open_basedir\]/s/^/;/' /etc/php-fpm.conf && \
sed -i '/^php_admin_value\[memory_limit\]/s/^/;/' /etc/php-fpm.conf && \
echo "open_basedir=/app:/dev/stdout:/tmp:/usr/bin/jpegoptim:/usr/bin/optipng:/usr/bin/cwebp:/usr/bin/cavif" >> /etc/php/8.3/fpm/conf.d/70-custom.ini
@jessedobbelaere thank you for the report, I will look into this and let you know.
Description
Overriding PHP settings with env variables such as
PHP_MEMORY_LIMIT
does not seem to work at the moment.Issue 1: not loading the craftcms.ini
The
60-craftcms.ini
file does not get loaded by PHP:The Dockerfile might not be using the right location to put
60-craftcms.ini
in?Issue 2: settings cannot get overridden because of
php_admin_value
After fixing the issue where
60-craftcms.ini
did not load, I could see the ini file loaded in phpinfo ✅ . However, thememory_limit
still did not change ⚠️I figured out that
memory_limit
is set in the php-fpm settings using:I looked it up and found:
So in fact, there's no way that any .ini file can override settings like
memory_limit
. Could this get fixed?Feature request: allow to override
open_basedir
Should there be an ENV var to modify
open_basedir
? Or at least, also stop usingphp_admin_value
here and switch tophp_value
so I can copy a custom .ini to overrideopen_basedir
?👉 I have installed
/usr/bin/cwebp
,/usr/bin/cavif
,/usr/bin/jpegoptim
and/usr/bin/optipng
that Imager-X needs to use. Theopen_basedir
feature of PHP prevents PHP from using files in the/usr/bin
directory. So I need to modify it with a .ini file, but that requires me to usesed
magic to uncomment theopen_basedir
in the php-fpm config, unfortunately.Quite the hack, but using this I could proof the steps to override the
open_basedir
setting:Steps to reproduce
examples/nginx
and add an environment variable as mentioned in the README.mddocker compose up
memory_limit
--> it will be set at 256M instead of 512M!. You will also see that it did not load60-craftcms.ini
at all.