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?
3 Answers 3
quick solution add memory size in the command :
php -dmemory_limit=6G bin/magento setup:static-content:deploy
change 6G to what you want
-
3FWIW, we recommend 768M for normal use and 2G for testing. Your mileage might vary... exampleSteve Johnson– Steve Johnson2016年01月18日 15:47:33 +00:00Commented Jan 18, 2016 at 15:47
-
1I have only a template installed and a single product, setting 2G still gets the memory error. Why is this damn thing so memory consuming?Scott– Scott2017年11月13日 19:31:50 +00:00Commented 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_limitJino– Jino2021年08月17日 11:23:53 +00:00Commented Aug 17, 2021 at 11:23
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
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