I recently upgraded to Mountain Lion and reconfigured my apache2 (https.conf) file in the terminal to load PHP and start automatically.

My localhost/~username/phpinfo.php page comes up to show my PHP configuration (php.ini). I see that upload_files is set to ON and the max_size_upload is set to 20MB. However, the upload_tmp_dir isn't set (it says NO VALUE). I assume the default tmp directory is "/tmp".

When I do

$ cd /etc/
$ sudo nano php.ini.default 

goto the upload_tmp_dir and I remove the ; in front of it and enter the value /tmp (save and exit).

I still see NO VALUE for the upload_tmp_dir when I load my phpinfo.php. I just wonder if I'm doing something wrong. Any help is appreciated.

  • Did you restart apache after changing the setting? I.E. Turn off/on web sharing (i think?) in sys prefs?
    – Benno
    Commented Sep 30, 2012 at 15:14

2 Answers 2


/etc/php.ini.default serves only as a reference and is not read out by PHP at all. The built-in PHP installation will look for the file /etc/php.ini instead. This file is not present by default, but you can copy /etc/php.ini.default to /etc/php.ini and make your modifications in there. You could also just create an empty file and only add any directives you want to change from the default.

Make sure you copy or create the file as root, so in Terminal you could do:

sudo cp /etc/php.ini.default /etc/php.ini

After modifying the php.ini, also make sure you restart Apache for the settings to take effect.

It is good practice to not modify /etc/php.ini.default directly, so you can use it as a reference if anything goes wrong with your /etc/php.ini.


If you have multiple installations of php, then you should use the php command to find the ini files.

$ /usr/local/opt/php56/bin/php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/5.6
Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed:      (none)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .