- Create a
~/Sitesfolder if you don’t already have one - Enable PHP by uncommenting the
php5_moduleline in/etc/apache2/httpd.conf - Find the line that read
User _wwwand change the_wwwto your username (whoami) - Find the
DirectoryIndexline and change it toDirectoryIndex index.php index.html index.htm - Change the
DocumentRootline toDocumentRoot "/Users/yourusername/Sites/" - Change the
<Directoryline to<Directory "/Users/yourusername/Sites/"> - Run
sudo apachectl restart - Restart your computer (yes, this is necessary)
- PHP sites can be placed in your
~/Sitesfolder and run and accessed athttp://localhost/~username/path/to/project
If you installed mysql through homebrew, the database connection will always work at the following host path: localhost:/tmp/mysql.sock
If you want to edit the php.ini file, run cp /private/etc/php.ini.default /private/etc/php.ini and make the adjustments necessary.
If you are updating wordpress, you need to chmod all the folders in your project to 777 so the update system can write them. You can use chmod -R 777 . in the project root to do this. You also need to add the line define('FS_METHOD', 'direct'); to your wp-config file.
sweet