1//Unlimited momory limit
2ini_set('memory_limit', '-1');
3
4//Fixed memory limit
5ini_set('memory_limit','2048M');
1/*
2To increase the PHP memory limit setting, edit your PHP.ini file found under /usr/local/etc/php/7.4/.
3Increase the default value (example: Maximum amount of memory a script may consume = 128MB) of the PHP memory limit line in php.ini.
4*/
5
6memory_limit = 256M
1Terminal:
2
3 php --ini
4
5 vi /usr/local/etc/php/7.4/php.ini
6
7php.ini
8
9 Search for the string memory_linit
10
11 Press Esc :/memory_limit
12
13 Then press i and change the value to -1
14 // -1 : We don't limit the quantity of memory of PHP
15 memory_limit = -1 // By default = 128M
16
17 Then press Esc:w to save and Esc:q to close the file