Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
    
Did you restart apache after changing the setting? I.E. Turn off/on web sharing (i think?) in sys prefs? –  Benno Sep 30 '12 at 15:14
add comment

1 Answer

up vote 10 down vote accepted

/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.

share|improve this answer
    
Thanks, that did the trick. –  post.72 Oct 1 '12 at 16:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.