1) Download XCode from Apple from the page: https://developer.apple.com/technologies/tools/ After you ‘ok’ the license install the command line tools by going to XCode->Preferences then clicking on Download. Next click on the ‘Install’ button to download and install the command line tools.
Download and install mac port.
port search <search string>
Next from the command line Install Apache2:
sudo port install apache2
Next install PHP,
sudo port install php5 +apache2 +mysql5 +pear
Enable PHP in apache by typing:
sudo /opt/local/apache2/bin/apxs -a -e -n “php5” libphp5.so
Setting up named based hosting directory:
edit the httpd.conf file with your favorite editor, in this example I am using joe.
sudo joe /opt/local/apache2/conf/extra/httpd-vhosts.conf
Comment out all the existing virtual hosting and add a configuration for named based virtual hosting:
# Use name-based virtual hosting.
# include the server name in the filenames used to satisfy requests
SetEnv APPLICATION_ENV “development”
php_value include_path “.:/var/lib/Zend/ZendFramework-1.12.0/library”
Options Indexes FollowSymLinks Includes
Allow from All
Now create the web directory:
sudo mkdir /var/www
Now set the permission for the directory (Note, this is for a development system not production)
sudo chmod a+rw /var/www
Edit your host file to add some hosts:
Find and un-comment the line in your httpd.conf file:
# Virtual hosts
# PHP5 Config
DirectoryIndex index.html index.php index.phtml
Extract zend framework into your lib directory from the httpd-vhost.conf file (Note your version my vary).
sudo port install mysql55 +server
sudo port install mysql55-server
sudo /opt/local/lib/mysql5/bin/mysql_install_db –user=mysql