Search code examples
phpnginxcomposer-phpsymfony-3.3fpm

Allowed memory size exhausted in Symfony 3.3


On my production server with the following configuration:

  • Nginx
  • phpfpm-7.0
  • List item

Symfony3.3

I still receive 500 error while targeting home page with the following error in my phpFpm error logs acceding the app.php page:

[error] 16800#16800: *9 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 4096 bytes) in .../vendor/composer/autoload_static.php on line 4248" while reading response header from upstream, client: XXXXXXXX, server: _, request: "GET /app.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "XXXXXXX"

I tried to increase the memory_limit param in those locations without any change:

  • /etc/php/7.0/fpm/php.ini
  • /etc/php/7.0/fpm/php-fpm.conf
  • /etc/php/7.0/fpm/pool.d/www.conf
  • /etc/php/7.0/cli/php.ini

Do you have any idea where could it come from?


Solution

  • Ok solved.

    My issue was coming from extra configuration which was into /etc/php/7.0/fpm/php-fpm.conf file overriding the php.ini conf.

    Thank you!