How to Install WordPress and MediaWiki on Mac OS X

From PoIC
Revision as of 21:11, 12 January 2008 by Hawkexpress (Talk | contribs) (Install [ MediaWiki] 1.9.1)

Jump to: navigation, search

How to install MediaWiki and Wordpresson local computer.

Configure Apache

  • modify Apache's configure file "httpd.conf" to load PHP module.
% cd /etc/apache2
% sudo vi httpd.conf
  • Find the line "#LoadModule php5_module libexec/apache2/". Remove the comment "#" and save.
  • Go System's Preference Pane. Activate "Web Sharing" in "Sharing".

Install MySQL 5.0

Currently, there are four version of MySQL is available : 4.0, 5.0, 5.1, and 6.0. The v. 5.0 is the most easiest to install because this version provides .pkg installer.

  1. Download MySQL 5.0 from official web site
    • Find "Mac OS X (package format) downloads"
    • Download package "32-bit" for G4, "64-bit" for G5, or "x86" for Intel
  2. Open the downloaded .dmg file
    • Install "mysql-standard-5.0.27-osx10.4-powerpc-64bit.pkg"
    • Install "MySQLStartupItem.pkg"
    • Put "MySQL.prefPane" file into ~/Library/PreferencePane

Configure MySQL on command line

  • Add to ~/.tcshrc
 set path = ( $path /usr/local/mysql/bin )

 alias mysql /usr/local/mysql/bin/mysql
 alias mysqladmin /usr/local/mysql/bin/mysqladmin
  • Add to ~/.login
setenv PATH ${PATH}:/usr/local/mysql/bin
setenv MANPATH "${MANPATH}:/usr/local/mysql/man"
  • Activate MySQL Server from "My SQL" in Preference Pane.
  • Configure MySQL admin password on
% mysqladmin -u root password blahblahblah

Install PHP 5.0

On Leopard

It seems the PHP 5.2.4 is already installed on Leopard. This case, you can skip this section. Check the version by,

% php -version

On Pre-Leopard

  1. Download PHP for Mac OS X at Marc Liyanage's site.
    • "PHP 5 on Mac OS X 10.4, PPC and Intel", "PHP 5.2.0 for Apache 1.3" (direct link)
    • Check apache's version by using "% httpd -v" on
  2. Open .pkg and run the installer

Configure PHP on command line

  • Add to ~/.tcshrc
set path = ( $path /usr/local/php5/bin )

Install MediaWiki 1.9.1

  1. Download MediaWiki 1.9.1 from official web site
  2. Unpack and settle the folder at ~/Site/wiki
  3. Setting MediaWiki
    • Access http://localhost/~/yourname/wiki/
    • Proceed MediaWiki configuration
    • Use MySQL admin name and password for automatic database creation (root, blahblahblah)
      • Database type: MySQL
      • Database host: localhost
      • Database name: wikidb
      • DB username : wikiuser
      • DB password : ******** (<-different from MySQL's root password
      • DB password confirm: *******
      • Superuser account: On (<- Check)
      • Superuser name: root
      • Superuser password: ******** (<-MySQL's password, blahblahblah)

Install WordPress

% mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
   -> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
  • Typically,
    • databasename : wordpress
    • wordpressusername : wordpress
    • hostname : localhost
    • password : (as you want)


  • MySQL create a database somewhere (please follow if you know where!). You must backup the database file sometimes. Especially, take care when you are going to perform clean install of Mac OS X.