-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP ini overrides are not working #8
Comments
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. |
I have the same problem. Are there any plans for timing? @jasonmccallister |
I have to say that the situation with the Docker images is pretty disappointing. The old image is deprecated, and the new one isn’t really usable. It’s frustrating that issues like this one, or another one I opened #14, aren’t getting any attention. |
Hi all, appreciate your patience. Now that Cloud has launched and things have gone back to some semblance of normal here I'm circling back to our public container images. @jessedobbelaere, @internetztube I'm going to try and reproduce this. None of the clients that use these images have had a need to tweak the PHP configuration. @carlcs do you mind elaborating on how you consider these unusable? We have received a lot of feedback over the years about the other images saying they are too opinionated and difficult to customize (e.g. people wanting to swap Nginx for Caddy). We opted for a base image with requirements and less opinions and are using these for some enterprise customers with really good success. I'm happy to discuss if you feel things are missing or we could do things to make it easier to use these images. As far as #14, I did need to follow up on it but saw that it was closed. Again, happy to discuss ways we can make these images easier to use. |
Just resolved this and verified on PHP 8.3 with the following command: $ docker run --rm -it -e PHP_UPLOAD_MAX_FILESIZE=100M --pull=always --entrypoint php-fpm ghcr.io/craftcms/image:8.3 -i | grep upload
8.3: Pulling from craftcms/image
Digest: sha256:41d989b8e7c0ead233cb825e2b76caec12342fdfbebc6bbcfb396572cd933b09
Status: Image is up to date for ghcr.io/craftcms/image:8.3
file_uploads => On => On
max_file_uploads => 20 => 20
upload_max_filesize => 100M => 100M
upload_tmp_dir => no value => no value
session.upload_progress.cleanup => On => On
session.upload_progress.enabled => On => On
session.upload_progress.freq => 1% => 1%
session.upload_progress.min_freq => 1 => 1
session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix => upload_progress_ => upload_progress_ I'm going to add this to the other images and also ensure the |
Marking this as resolved, these actions will update the 8.2 and 8.1 images with the changes: https://github.com/craftcms/image/actions/runs/10725422755 |
Hi @jasonmccallister thanks for looking into it! That should do it However my post also had a |
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, the
memory_limit
still did not changeI 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.The text was updated successfully, but these errors were encountered: