2. Create a useable version of the PHP ini file$ sudo cp /private/etc/apache2/httpd.conf /private/etc/apache2/httpd.conf.pre-php-enable
$ sudo sed -e 's/^#\(LoadModule php5_module.*\)/\1/' /private/etc/apache2/httpd.conf.pre-php-enable > /private/etc/apache2/httpd.conf
$ sudo cp /private/etc/php.ini.default /private/etc/php.ini
3. Create a user-specific Apache config file
$ sudo echo '
<Directory "/Users/$LOGNAME/Sites/">
Options Indexes Multiviews
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
' > /etc/apache2/users/$LOGNAME.conf
4. Start the server$ sudo apachectl start5. Create a test file
$ echo 'echo "Hello World!";?>' > $HOME/Sites/hw.php6. Validate everything is working
$ curl http://localhost/~$LOGNAME/hw.php7. Launch Xcode to do more interesting edits
Hello World!
$ open -a /Applications/Xcode.app $HOME/Sites/hw.php
Biblio: