1

If I run php -ini I get:

Configuration File (php.ini) Path => /usr/local/etc/php/7.4
Loaded Configuration File => /usr/local/etc/php/7.4/php.ini

If I run phpinfo() (I use Laravel Valet to serve my app locally) I get:

Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File: /usr/local/etc/php/7.4/php.ini

So they're the same. I then run sudo nano /usr/local/etc/php/7.4/php.ini and update memory_limit to 2048M.

Then I run: php -ini: the new memory_limit is updated to the new value. But if I run phpinfo() it still says 128M. Even after brew services restart php@7.4 and valet restart.

This is driving me crazy, what am I missing?

eskimo
  • 2,421
  • 5
  • 45
  • 81
  • Does ```ini_set('memory_limit','2048M');``` at the start of your page work ok? If so, check for any other ```ini_set```s and other ```.htaccess``` files. – Antonios P. Sep 18 '20 at 14:32
  • Nope. And there's not `.htaccess` as it's nginx. But I figured out what it was, I'll post an answer. – eskimo Sep 18 '20 at 18:28
  • See https://stackoverflow.com/a/51953782/2494754 – NVRM Sep 18 '20 at 18:48

1 Answers1

0

So it turns out that valet runs php, not brew... When I ran brew services stop php@7.4 everything still worked. Then I came across this article, followed the steps there and it worked. I'm still slightly puzzled as to why phpinfo() displays that ini file path though.

eskimo
  • 2,421
  • 5
  • 45
  • 81
  • It could be because PHP originally linked those files as its config, but valet is really running it? IDK, though for sure. Interesting... – Antonios P. Sep 18 '20 at 18:51
  • Hi, Am facing the same issue and the linked article isn't working. How did you solve it? – Asme Just Aug 26 '22 at 00:17