PHP Fatal error: Allowed memory size of …

Fix PHP Fatal error: Allowed memory size of… bytes exhausted.

Errors of the form:

PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar: ///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar: ///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 167772160 bytes) in phar: ///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 90

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 167772160 bytes) in phar: ///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 90

The bottom line is that there is not enough memory to process the script / application / installer.

We look at the allowed amount of memory:

php -r “echo ini_get (‘memory_limit’). PHP_EOL;”

We go to the php settings file (the path may be different):

/usr/local/etc/php/7.3/php.ini

See where PHP.ini is located:

Change

; memory_limit = 128M
memory_limit = 4096M

Overloading (on Mac OS)

brew services restart php

If this is not a local server, then reload php depending on the installed operating system.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *