Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 13965430 bytes)
PHPInfo shows that I have a memory_limit of 128M, so I'm confused as to why the error says I only have 64M. Is it possible for phpinfo to report incorrectly? Or for PHP to use two separate php.inis?
The error was being caused by an ini_set call in one of the primary php files that a co-worker of mine added without my knowledge.
The correct way is to edit your php. ini file. Edit memory_limit to your desire value. As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.
Try prefixing your command with COMPOSER_MEMORY_LIMIT=-1 . This will remove the memory limit for the execution of the command. Update: Memory exhaust errors should now be resolved by using Composer 2.
PHP's config can be set in multiple places:
php.ini
(usually in /etc somewhere)php_value
)php.ini
(use the command php -i | grep memory_limit
to check the CLI conf)php_value
)ini_set()
)In PHPinfo's output, the "Master" value is the compiled-in default value, and the "Local" value is what's actually in effect. It can be either unchanged from the default, or overridden in any of the above locations.
Also note that PHP generally has different .ini files for command-line and webserver-based operation. Checking phpinfo()
from the command line will report different values than if you'd run it in a web-based script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With