You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a recap for php_admin_value, these cannot get overwritten with regular .ini files:
Unlike php_value, php_admin_value stands immune to local overwrites. Regardless of the attempts made in individual directories or files to alter the same configuration setting, the global directive set via php_admin_value remains supreme. This characteristic renders it an excellent choice for safeguarding vital configurations against inadvertent alterations.
So in fact, there's no way that any .ini file or env variable PHP_MEMORY_LIMIT can override settings like memory_limit.
Steps to reproduce
Clone this repository
cd examples/nginx
Add an env variable to the docker-compose.yaml, like advertised in the README.md:
version: "3.8"
services:
web:
image: craftcms/web:local
build:
context: .
dockerfile: Dockerfile
args:
- php_version=8.2 # this is passed to the FROM in the Dockerfile
ports:
- "8080:8080"
volumes:
- ./local:/app
+ environment:+ PHP_MEMORY_LIMIT: 512M
docker compose up -d
Visit http://localhost:8080 and search for memory_limit which is set to 256M which is the value used by php_admin_value
As a workaround i'm commenting out the line in /etc/php-fpm.conf in a Dockerfile build that extends from the 8.3 image 😅 After commenting it out, the override actually works.
RUN sed -i '/^php_admin_value\[memory_limit\]/s/^/;/' /etc/php-fpm.conf
Note
I have a similar issue with open_basedir which is set through php_admin_value so I cannot override it with a .ini file. I have to use sed to comment out the open_basedir first before overriding it. I need to override the open_basedir because of jpegoptim, optipng, cwebp, cavif, ... which are all common image optimizers used in Craft CMS. Should we just remove all php_admin_value settings and turn them into regular .ini settings so devs have the option to add overrides?
Additional info
Craft version: /
PHP version: 8.3
Database driver & version: /
Plugins & versions: /
The text was updated successfully, but these errors were encountered:
Description
tl;dr The README mentions you can specify the env variable
PHP_MEMORY_LIMIT
, but this does not work.I figured out that
memory_limit
is set by both60-craftcms.ini
image/etc/php.d/60-craftcms.ini
Line 1 in 77f5058
but also by
php-fpm.conf
using:image/etc/php-fpm/php-fpm.conf
Line 225 in 77f5058
As a recap for
php_admin_value
, these cannot get overwritten with regular .ini files:So in fact, there's no way that any .ini file or env variable
PHP_MEMORY_LIMIT
can override settings likememory_limit
.Steps to reproduce
cd examples/nginx
docker-compose.yaml
, like advertised in the README.md:docker compose up -d
memory_limit
which is set to 256M which is the value used byphp_admin_value
/etc/php-fpm.conf
in a Dockerfile build that extends from the 8.3 image 😅 After commenting it out, the override actually works.Note
I have a similar issue with
open_basedir
which is set throughphp_admin_value
so I cannot override it with a .ini file. I have to usesed
to comment out theopen_basedir
first before overriding it. I need to override theopen_basedir
because of jpegoptim, optipng, cwebp, cavif, ... which are all common image optimizers used in Craft CMS. Should we just remove allphp_admin_value
settings and turn them into regular .ini settings so devs have the option to add overrides?Additional info
The text was updated successfully, but these errors were encountered: