Skip to content

Commit f1f6ce6

Browse files
committed
api: increase default memory limit to 500M in development
With php 8.3 it got even cloud native and allows to set ini values from env vars: https://www.php.net/manual/en/configuration.file.php#example-33 Can be overridden in .env. If the variable is not set, the php default (128M) is used. I did not set the default in the api-platform.dev.ini because if I used the fallback empty string in the docker compose (that docker compose does not complain that it is not defined), the fallback in the php ini is not used. Do not use api/.env to set the default value because we don't need that for prod. Another valid place to set the value would be the development stage in the docker build. Issue: #8036
1 parent e656ec4 commit f1f6ce6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

api/docker/php/conf.d/api-platform.dev.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
; See https://github.com/docker/for-linux/issues/264
33
; The `client_host` below may optionally be replaced with `discover_client_host=yes`
44
; Add `start_with_request=yes` to start debug session on each request
5-
xdebug.client_host = host.docker.internal
5+
memory_limit = ${PHP_MEMORY_LIMIT:-}
6+
xdebug.client_host = host.docker.internal

docker-compose.override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ services:
2424
# This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
2525
# Then PHPStorm will use the corresponding path mappings
2626
PHP_IDE_CONFIG: serverName=localhost
27+
PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT:-500M}
2728
PERFORMANCE_TEST_DEBUG_OUTPUT: ${PERFORMANCE_TEST_DEBUG_OUTPUT:-}
2829
user: ${USER_ID:-1000}

0 commit comments

Comments
 (0)