![]() ![]() Optional: If you wish to have MySQL start on boot, you do need to additionally install the MySQLStartupItem.pkg file. If you are not sure where to install the preference pane, choose “Install for this user only.” Once the Installer script is completed, install the Preference Pane by double-clicking on MySQL.prefPane. Open the downloaded disk image and begin by installing the mysql-5.x.x-osx10.6-x86_64.pkg file. As of this writing, the most recent version says OS X 10.6, but it will work on 10.7 as well. Go to the download site for OS X pre-built binaries at and choose the DMG Archive most appropriate for your system. MySQL is the only thing not shipped with OS X that we need for our development environment. $ sudo bash -c "cat > /etc/php.ini > ~/.bashrc > /etc/php.ini Sharing for the new PHP options to take effect. $ sudo bash -c "grep php /etc/apache2/nf|grep LoadModule|cut -d'#' -f2 > /etc/apache2/other/nf" We’ll enable mod_php for Apache, and also set up an /etc/php.ini file based on the default one shipped with Lion with some development-friendly changes. OS X has shipped with PHP for quite some time, but not had it enabled by default. See Apache’s documentation for more information. ![]() Edit /etc/hosts (or use Gas Mask) and add an entry for 127.0.0.1 for your project.local, and make the appropriate change in the conf file, along with the correct DocumentRoot and Log file locations. To add a site, duplicate the section under the Template, remove the comments, and edit appropriately. Then click on the blue underlined link under “Your computer’s website is available at this address:” to ensure Apache is working correctly, and you should see text saying “It works!” Launch System Preferences and go to Sharing and toggle Web Sharing off and on so it’s started and reloaded with the new settings. # DocumentRoot "/Users/name/Sites/domain.local" # ErrorLog "/Users/name/Sites/logs/domain.local-error_log" # CustomLog "/Users/name/Sites/logs/domain.local-access_log" combined Options Indexes FollowSymLinks MultiViewsĭocumentRoot /Library/WebServer/Documents # Set up permissions for VirtualHosts in ~/Sites Note that you’ll need to change all instances of “/Users/name” to your actual home folder path. $ sudo ln -s ~/Sites/nf /etc/apache2/otherĮdit the new ~/Sites/nf file and add the following. We’ll keep the Apache information and our website roots in ~/Sites, and Apache logs in ~/Sites/logs $ & mkdir ~/Sites We’ll set things up so we won’t need sudo often in the future, and so we can manage multiple VirtualHosts. Note that for all commands before that are starting with a $, the dollar sign is showing a command-line prompt in Terminal, and you should not actually type it as part of the commands. In an effort to keep this from being overly wordy and just get to the good stuff, we’ll dive right in, so read on to get started. With the release of Lion, there are some subtle differences to setting up a local MAMP (Mac OS X, Apache, MySQL, PHP) environment compared to Snow Leopard.
0 Comments
Leave a Reply. |