How to fix PHP.INI that is not updating in an apache mac setup

php-style-006

If you issue the following command in terminal:

php --i | grep ini

This will show you the loaded pho configuration file. My output was this:

Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini

But when I upgraded my MacOS from El Capitan to Sierra, updating the above file didn’t reflect any change on my development websites. WordPress was still showing 2 MB even though I was using the following:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

After googling here and there, I found a solution. Thanks to Gergely on stackoverflow here.

First use phpinfo to find out the current loaded file.

You would see:

Loaded Configuration File  None

now open your terminal:

cp /etc/php.in.default /etc/php.ini

Thats it. Make any change to the newly copied file and it would update in the webserver without any issues 🙂

Leave a Reply