Increase memory_limit and max_execution_time in Laravel Valet

If you use Laravel Valet and want to increase the memory_limit, you have to edit php-memory-limits.ini:

sudo nano /usr/local/etc/php/7.3/conf.d/php-memory-limits.ini

If you want to increase max_execution_time, you have to edit php.ini:

sudo nano /usr/local/etc/php/7.3/php.ini

Maybe you have to modify the php version, if you use another one. After changing the values to the desired ones, you have to restart php:

sudo brew services restart php

Now you are done, memory_limit and max_execution_time should be increased.

Update

With newer versions of PHP / Valet, you have to modify /usr/local/etc/php/7.4/php-fpm.d/valet-fpm.conf:

sudo nano /usr/local/etc/php/7.4/php-fpm.d/valet-fpm.conf

Here, you can increase the memory_limit:

[...]
php_admin_value[memory_limit] = 512M
[...]

After changing the value, restart Valet:

valet restart