8

I am trying to setup Magento 2.0 (community) in a WAMP server and I am getting the error below all the time while I run the command for deploy the assets static due to symlink issues at Windows environments:

php bin/magento setup:static-content:deploy

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in C:\wamp\www\magento\vendor\oyejorge\less.php\lib\Less\Visitor\processExtends.php on line 445

I have setup memory_limit as -1 (no limit) but this takes no changes. I don't know what else to do in this case since the issue goes beyond my PHP knowledge and setting that value to no limit should do the job unless I need to install something else to get this working. Any advices? Any workaround?

asked Jan 17, 2016 at 22:38

3 Answers 3

55

quick solution add memory size in the command :

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

change 6G to what you want

answered Jan 18, 2016 at 0:52
3
  • 3
    FWIW, we recommend 768M for normal use and 2G for testing. Your mileage might vary... example Commented Jan 18, 2016 at 15:47
  • 1
    I have only a template installed and a single product, setting 2G still gets the memory error. Why is this damn thing so memory consuming? Commented Nov 13, 2017 at 19:31
  • php -d memory_limit=6G bin/magento setup:static-content:deploy . There should be a space after -d and before memory_limit Commented Aug 17, 2021 at 11:23
1

In dev mode I managed to solve this issue by running the following command: rm -rf pub/static/* var/di var/generation var/cache var/page_cache

answered Apr 20, 2017 at 11:04
0

Increase the memory limit to update .php.ini file

If you have access to your php.ini file or can create one in the root, you can globally increase your allocated memory.

;adjust memory limit
memory_limit = 6G
max_execution_time = 36000
max_input_time = 36000

If you not want to update .php.ini file then use below command

php -dmemory_limit=6G bin/magento setup:static-content:deploy
answered Jul 18, 2018 at 12:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.