I know this is a repeated question, but I couldn’t find a solution after trying all the answers discussed here.
When I run php bin/magento setup:upgrade
command, it shows error like
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 12288 bytes) in /var/www/html/mysite/vendor/paragonie/sodium_compat/lib/sodium_compat.php on line 214
Modified memory_limit
value in php.ini file, but still issue exists. Any other solutions for this problem?
2
Answers
Make sure you edited the correct php.ini.PHP executed via the web server, and run via command line, often use two different ones
Just add this below line to before line of you getting error in your file
It will take unlimited memory usage of server.
OR
in yourr PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
If you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
The simplest way to do this, without the need to change your config is to specify the memory limit when you run the command.