command line change php memory limit code example

Example 1: php memory_limit cli

php -d memory_limit=-1

Example 2: get php memory limit command line

php -i | grep "memory_limit"

Example 3: Increase the PHP memory limit

/*
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

Tags:

Php Example