Welcome to part 4 of the MAMP tutorial. In this post we will go over setting up php.ini on your Mac’s localhost.
What green means: any lines that you need to replace in this tutorial will be in green.
1. Enable the php.ini file:
1. Using Terminal, copy the existing php.ini.default and rename it to php.ini
sudo cp /etc/php.ini.default /etc/php.ini
2. Open php.ini in nano in your terminal for editing
sudo nano /etc/php.ini
2. Enable php short tags:
A php script with short tags will not run on your server unless php short tags are enabled.
1. Hold ctrl + w to do a string search. Type “short_open_tag” to find the line. (You may need to search a couple times)
short_open_tag = Off
2. Replace it with
short_open_tag = On
3. Disable detect_unicode:
detect_unicode is a deprecated feature and will be disabled in the future. But for now we need to disable it so it doesn’t cause us problems.
1. Go to the very end of the php.ini file (still open in nano) and add the following line to the end of the file. It doesn’t exist yet.
detect_unicode = Off
4. Set the timezone:
1. Hold ctrl + w to do a string search. Type “date.timezone” to find it.
date.timezone = UTC
UTC tells the server to use your local timezone.
Save the file and exit. and congrats. You are done!