I’m sick of forgetting where to find my local development files so here is a quick breakdown. It includes hosts file, httpd.conf and php.ini
The hosts file is used to point domains at an i.p although in most cases it will just be a list of 127.0.0.1 and a domain name such as mysite.local or mysite.hjb in my case.
For < 10.5 you used to use netinfo manager to add extra domains and didn't really use the host file, although in 10.5 (and probably later) you do use the host file. locations:
The main apache config file. This is where all the setting for apache are stored. After making changed you need to restart web sharing in system preferences sharing for them to have an effect.
The main php config file. This is where all the setting for php are stored. After making changed you need to restart web sharing in system preferences sharing for them to have an effect.
This is where your actual site files are stored and depends on if you are using the default osx install or a 3rd party install. I strongly suggest Marc Liyanage‘s help here as it deals with plenty of plugins too including the always useful gd2 image library.
5 Replies to “Location of hosts httpd.conf php.ini on Mac OSX”
The tilde “~” is a shell shortcut to the home directory.
For the paths above to be valid, you must remove the tilde prefix.
The info about php.ini’s location pertains to a manual install of PHP, in /usr/local, as opposed to OS X’ standard location, right?
If I’m not mistaken, OS X’ preinstalled PHP uses this location:
httpd.conf is located at
on Mac Os X 10.5.8
The default location for php.ini is infact /private/etc/
Comments are closed.