Environment
PHP Advanced Environment
Categories:
Memory
Allowed memory size of 134217728 bytes exhausted
The default memory limit is 128MB
that set from the php.ini
file. You can update the configuration file or set the memory usage during running the php code
Update the php.ini
# memory_limit = 128M
memory_limit = 512M
# memory_limit=4096M
Set memory limit from php function
// Increase Memory
ini_set('memory_limit', '512M');
// Unlimit Memory
ini_set('memory_limit', '-1');
From php cli
# Normal php code
php -d memory_limit=512M your_php_file.php
# Laravel artisan
php -d memory_limit=512M artisan