I'm trying to switch Deploy mode Developer to Production but after running the command " php bin/magento deploy:mode:set production" , Console showing the error for "Fatal error: Allowed memory size of 134217728 bytes exhausted".
I do not want to make any change in php.ini file for this issue.
Please suggest some solution if anyone can help me.
Solved! Go to Solution.
Hello @tarunkumar081
php -dmemory_limit=-1 bin/magento deploy:mode:set productionIf you still get the same error, then you need to increase memory_limit on the server.
Hello @tarunkumar081
php -dmemory_limit=-1 bin/magento deploy:mode:set productionIf you still get the same error, then you need to increase memory_limit on the server.
php.ini for CLI and browser are different.
you can update the php.ini for CLI only that will not apply to browsers
check with the following command Loaded Configuration Files command line
php --ini
in my server its
/etc/php/7.2/cli/php.ini
you can update the memory_limit to 4G here
memory_limit = 4G
and run the command
else you can just run the command with memory_limit as a parameter with -d
php -d memory_limit=4G bin/magento deploy:mode:set production
kindly accept as a solution if this works for you and give Kudos
@amitsamsukha I've tried this command "php -d memory_limit=4G bin/magento deploy:mode:set production" But It didn't work over there. I think I would have to update the php.ini file for the same.
Try to run this command in your terminal ;
php -dmemory_limit=-1 bin/magento deploy:mode:set production
you can use any value if you know how much memory it required or -1 if it have no memory limit.