`fideloper/fly-laravel` seems to have stopped respecting `PHP_MEMORY_LIMIT`?

The apps don’t even run at all, because it immediately crashes as soon as php boots.

2023-10-01T23:19:31Z app[1857939c420428] fra [info][01-Oct-2023 23:19:31] NOTICE: PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 12288 bytes) in Unknown on line 0

That’s only 128MB. I have configured PHP_MEMORY_LIMIT = "1024M" but it seems to be ignored. Two of our env’s are now offline and not sure what to do.


CC @fideloper-fly any idea maybe? Did you by any chance do a change to the fideloper/fly-laravel image?

I “fixed” it by overriding memory_limit in my Dockerfile:

sed -i 's/memory_limit = .*/memory_limit = 2048M/' /etc/php/8.2/fpm/php.ini

Hmmmmm, that sucks! Thanks for letting me know!

It looks like the fpm config SHOULD be pulling from system env vars still: https://github.com/fly-apps/laravel-docker/blob/main/src/fpm/pool.d/www.conf#L520

I did make a change recently to the base container, but it shouldn’t, in theory, effect FPM-based containers: [prototype] nginx unit version of image by fideloper · Pull Request #6 · fly-apps/laravel-docker · GitHub

I see that you’re editing php.ini, while that env var in this case is read within php-fpm’s pool.d/www.conf file (see that first link above for reference, it’s setting php_admin_value[memory_limit] = ${PHP_MEMORY_LIMIT}), which should in theory over-ride the php.ini value for the memory limit :thinking:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.