Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have error when i add module..

Please re-run Magento compile command

so i run below command but also display error that below when run command from root,

php magento setup:di:compile

Compilation was started.
%message% 0/7 [>---------------------------]   0% 1 sec 37.0 MiB%message% 0/7 [>
---------------------------]   0% 1 sec 37.0 MiBProxies code generation... 0/7 [
>---------------------------]   0% 1 sec 37.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% 47 secs 43.5
MiB
Repositories code generation... 1/7 [====>-----------------------]  14% 47 secs
43.5 MiB
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate
 24 bytes) in D:\xampp\htdocs\linsenwelt\vendor\zendframework\zend-code\src\Scan
ner\FileScanner.php on line 36

How to fix ?

share|improve this question

Looks like your cli has only 128MB of memory allocated. Increase the value to at least 256MB or 512MB if you can.

share|improve this answer
    
I tried 512mb size for my php.ini file but still not work...how solve ? – Khushi.M Dec 3 '15 at 11:36
    
If you still get Allowed memory size of 134217728 bytes then you didn't increase the memory limit for cli. – Marius Dec 3 '15 at 11:42
    
In which file i set memory limit ?? – Khushi.M Dec 3 '15 at 11:44

You need to increase memory allocated to php. To increase memory, execute command php --ini . Findout loaded php.ini. It should be like

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/05-opcache.ini,

Go to current loaded php.ini (/etc/php5/cli/php.ini) and findout memory_limit parameter. Increase the value against memory_limit parameter to 256M or 512M.

share|improve this answer

A Quick solutions for memory limit in magento 2 command is directly adding memory limit inside commannd,

For Compilation command,

php -dmemory_limit=5G bin/magento setup:di:compile

For Deployment

php -dmemory_limit=5G bin/magento setup:static-content:deploy

You can change as per 5G to max if issue not resolve.

share|improve this answer

I run into similar problem, memory limit was increased to 2Gb inside php ini file, phpinfo() file showed it was set to 2Gb. It seems Magento set memory limit manually somewhere. I increased memory limit inside file bin/magento. In first line I put this:

ini_set('memory_limit', '656M');

which made it working.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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