xxxxxxxxxx
//Unlimited momory limit
ini_set('memory_limit', '-1');
//Fixed memory limit
ini_set('memory_limit','2048M');
xxxxxxxxxx
// Method 1: Edit php.ini file
// Locate the php.ini file used by PHP on your server
// Find the "memory_limit" directive and modify it as desired
memory_limit = 256M
// Method 2: Set programmatically using ini_set() function
// Set the memory limit to 256MB
ini_set('memory_limit', '256M');
xxxxxxxxxx
/*
To increase the PHP memory limit setting, edit your PHP.ini file found under /usr/local/etc/php/7.4/.
Increase the default value (example: Maximum amount of memory a script may consume = 128MB) of the PHP memory limit line in php.ini.
*/
memory_limit = 256M