soderlind.no

I code for fun

Running WordPress locally on Mac OS X Lion

| 2 Comments


Want to run WordPress on OSX? I’ve wanted to do it for a long time and finally got a round to do it.

1 ) Installed Apache, MySQL and PHP on my Mac. I followed this excellent guide: OS X 10.7 Lion Development: Native MAMP with MySQL installer. Here’s the /Users/<username>/Sites/httpd-vhosts.conf I made:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# Set up permissions for VirtualHosts in ~/Sites
#
<Directory "/Users/<username>/Sites">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

# For http://localhost in the OS X default location
<VirtualHost _default_:80>
    ServerName localhost
    DocumentRoot /Library/WebServer/Documents
</VirtualHost>

#
# VirtualHosts below
#

# wp.local
<VirtualHost *:80>
    ServerName wp.local
    CustomLog "/Users/<username>/Sites/logs/wp.local-access_log" combined
    ErrorLog "/Users/<username>/Sites/logs/wp.local-error_log"
    DocumentRoot "/Users/<username>/Sites/wordpress"
</VirtualHost>

2) Installed WordPress in /Users/<username>/Sites/wordpress

When I tried to install the first plugin, I got the dreaded FTP Connection Information required :/

Luckily, Google to the rescue, I found this fix to allow WordPress automatic plugin installation/update:

A) Changed the owner and permissions for the entire WordPress installation, assuming you installed WordPress in /Users/<username>/Sites:

$ cd /Users/<username>/Sites
$ sudo chown -R :_www wordpress
$ sudo chmod -R g+w wordpress

B) Added the following to /Users/<username>/Sites/wordpress/wp-config.php:

define('FS_METHOD', 'direct');

Running WordPress locally makes it much easier to develop WordPress plugins wherever you are :)

2 Comments

  1. Pingback: WP FTP frissítés OSX Lion alatt | Feljegyzések

  2. Pingback: Running WordPress Multisite with MAMP « Socializing the Network

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Required fields are marked *.

*


Rodney's 404 Handler Plugin plugged in.