OSX Sierra - how to increase PHP memory limit correctly?

Maybe you should find out where php.ini is

sometimes this won't do:

php -i | grep php.ini   # turns out I just can't edit /etc/php.ini even when I'm root

then you can try this:

locate php.ini  # turns out it's here: /private/etc/php.ini

finally, edit /private/etc/php.ini with sudo

sudo vim /private/etc/php.ini 

save the file with

:wq!

job done.


One of the other included files has a memory_limit directive. Use this command to find which one:

grep memory_limit /usr/local/php5/php.d/*

The "Additional .ini files parsed" are parsed later, and will override settings in the main php.ini.