Changing PHP CLI memory limit on the fly

2020-04-20

There are some tasks in laravel that a php artisan would just be enough.

But there are tasks that would just consume the php config memory_limit.

You can always update your php.ini file and increase the memory_limit=1G for example or you can do this in your cli:

php -d memory_limit=1G heavy_script.php

or

php -d memory_limit=1G artisan command:name
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram