Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

carlituxman's avatar

laravel valet memory limit change?

How can I change the memory limit for laravel valet?

0 likes
16 replies
carlituxman's avatar

I'm looking for change a configuration and how do it?

shakti's avatar

do you have the access of php.ini then you might have to edit your php.ini file. Have a look for upload_max_filesize, memory_limit and post_max_size.

carlituxman's avatar

But I've at

/usr/local/etc/php/7.0/php.ini memory_limit = 256M

but phpinfo() shows 128M

carlituxman's avatar

The file is at /usr/local/etc/php/7.0/php.ini (like see in phpinfo())

The file is too many long, but I have:

[...] ; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 256M [...] ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 255555M [...] ; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; http://php.net/post-max-size post_max_size = 8M [...]

1 like
Sithira's avatar
Sithira
Best Answer
Level 2

i know this is a OLD question but here is the answer. in /usr/local/etc/php/7.0/conf.d there is an additional .INI by name php-memory-limits. there you will find the limitations.

19 likes
Mohammed_Zayan's avatar

You can find valet limits in this file

/usr/local/etc/php/7.2/conf.d/php-memory-limits.ini

The file has 3 limits : memory_limit, upload_max_filesize & post_max_size

change in this file and the new values will appear in phpinfo()

6 likes
galatanovidiu's avatar

Only changing the values on /usr/local/etc/php/x.x/conf.d/php-memory-limits.ini is not doing the job anymore.

/usr/local/etc/php/X.X/php-fpm.d/valet-fpm.conf PHP-FPM pool configuration file, is the place where memory limits can be modified

6 likes
maxxscho's avatar

This should be the correct answer for now.

shiroamada's avatar

OS: macOS 10.15.3 Valet: 2.8.1 PHP: 7.4.3 I changed

/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini memory_limit = 512M

I run valet restart to restart all then I run php -i | grep memory_limit , the output is correct. memory_limit => 512M => 512M

But when I go to web version. http://phpinfo.test/ to view my phpinfo(). It is still 128M. Image of PHPinfo()

My PHP-CLI is taking the new value effect, but web version does not work. In the phpinfo(), I check all the ini file, all is updated to 512M.

I even run valet restart nginx manually also does not take the new value effect. Any idea? Where I missed?

1 like
shiroamada's avatar

Ok, The treat is after I restart my Mac, the value is updated... RESTART is the most powerful skill

2 likes
keizah7's avatar

How I can save old /usr/local/etc/php/8.0/conf.d/php-memory-limits.ini settings then switching between multiple php versions?

keizah7's avatar

I have made alias because settings always changes.. Any solutions?

alias 80php="brew unlink php && brew link --force [email protected] && valet use [email protected] --force && nano /usr/local/etc/php/8.0/conf.d/php-memory-limits.ini"
sanampatel's avatar

If you installed the PHP with homebrew or have the multiple PHP version then the first check which is files are picked up by the current version of PHP

php --ini

In the response you will find the file which is used by the PHP,

Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.0
Loaded Configuration File:         /opt/homebrew/etc/php/8.0/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.0/conf.d
Additional .ini files parsed:      /opt/homebrew/etc/php/8.0/conf.d/error_log.ini,
/opt/homebrew/etc/php/8.0/conf.d/ext-opcache.ini,
/opt/homebrew/etc/php/8.0/conf.d/php-memory-limits.ini

Mostly it will be the php-memory-limits.ini file which you are looking for.

Please or to participate in this conversation.