- Create a
~/Sites
folder if you don’t already have one - Enable PHP by uncommenting the
php5_module
line in/etc/apache2/httpd.conf
- Find the line that read
User _www
and change the_www
to your username (whoami) - Find the
DirectoryIndex
line and change it toDirectoryIndex index.php index.html index.htm
- Change the
DocumentRoot
line toDocumentRoot "/Users/yourusername/Sites/"
- Change the
<Directory
line to<Directory "/Users/yourusername/Sites/">
- Run
sudo apachectl restart
- Restart your computer (yes, this is necessary)
- PHP sites can be placed in your
~/Sites
folder 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