The following instructions are what it finally took for me to get localhost working on my machine (a late 2008 MacBook Air with Snow Leopard v.10.6.8), and should be good for all operating systems up to (but not including) Yosemite. If you are using (or upgrading) to Yosemite, then make the changes as outlined at Apple Discussions. I followed their tutorial almost to a "T", but their setup won't allow for sessions, .htaccess files, and php mkdir()
functionality, so that is why I am giving you the whole kit and caboodle here. Following these instructions will have your Mac OS X ready to install BootPress.
Open up the Terminal and type:
sudo nano /etc/apache2/httpd.conf
Enter your password and uncomment:
#LoadModule php5_module libexec/apache2/libphp5.so
To:
LoadModule php5_module libexec/apache2/libphp5.so
In order to allow mkdir()
permissions, change:
User _www
To:
User <username>
Change the following lines:
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/Webserver/Documents">
AllowOverride None
To:
DocumentRoot "/Users/<username>/Sites/www"
<Directory "/Users/<username>/Sites/www">
AllowOverride All
There should be two (2) AllowOverride lines to fix. This is to enable .htaccess files.
To save push 'Control-X', then 'Y', and 'Enter'.
Type the command:
sudo nano /etc/apache2/users/<username>.conf
And enter the following:
<Directory "/Users/<username>/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from localhost
</Directory>
Save as above.
For sessions to work properly type:
sudo nano /etc/php.ini
Uncomment:
;session.save_path = "/tmp"
To:
session.save_path = "/tmp"
Save as before.
To get apache going with our new changes type:
sudo apachectl start
Or:
sudo apachectl restart
To ensure that all is well type:
apachectl -S
Be sure to fix any problems that come up.
To check on your installation of php type:
php -i
This will give you the same information as phpinfo()
.
Create a "www" folder in the "Sites" directory, and place an index.html file in it.