1

I'm getting the next error after docker-compose up.

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 12288 bytes) in /var/www/html/vendor/zendframework/zend-modulemanager/src/ModuleManager.php

Magento ver. 2.1.7 I'm using mageinferno/magento2-php:7.0-fpm-1

Here is docker-compose code:

version: '3'
services:

phpfpm:
    build: ./.docker/phpfpm
    links:
        - database
    volumes:
        - ./:/var/www/html
    environment:
        - XDEBUG_CONFIG=remote_host=10.200.10.1
        - PHP_IDE_CONFIF=serverName=terp

nginx: build: ./.docker/nginx links: - phpfpm volumes: - .:/var/www/html ports: - "8083:80"

database: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=qwerqwer - MYSQL_DATABASE=terp - MYSQL_USER=terp - MYSQL_PASSWORD=qwerqwer ports: - "3311:3306" volumes: - ./mysql-data:/var/lib/mysql

What could be the reason of that?

  • Looks like your memory limit (either PHP or docker) is set to 2mb. – Zefiryn Jul 4 '17 at 19:43
  • But I set limit to 2G – Dmitriy Arbuzov Jul 10 '17 at 10:48
  • I think php disagrees. Put 'phpinfo()' into index.php and double check – Zefiryn Jul 10 '17 at 10:54
  • I have about the same pb: Magento2 is ok, then i empty cache, and bam: memory limit, and then i have to restart my containers... without even being sure it will work -_- – Pol Ravalitera Oct 6 '17 at 9:43
0

I was able to solve this by adding the actual value directly inside the php.ini file and mounting my custom version of it in the container. Apparently the variable PHP_MEMORY_LIMIT is not there when running the cron.

You can see the default php.ini file here https://github.com/mageinferno/docker-magento2-php/blob/master/conf/php.ini

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.