WordPress on Mac Part 1: PHP & MySQL
Posted on Monday, August 22nd, 2005 at 6:01 pm under Mac Geekery, Tutorials, Web, Wordpress.This guide will help you run Wordpress (the blog application that runs this website) in your own personal Mac for testing purposes or for backing up your blog. This Tutorial will cover installing PHP and MySQL, setting up local sub-domains and installing Wordpress. Why would you want to do this? Well, because you can. Mac OS X is built on Unix which gives us access some very cool things like the Apache server. Local development is great because you can develop even when you don’t have an internet connection like when traveling on a plane.

Technorati Tags: apple, blog, mac, web design, wordpress
What’s in a name?
If you are unfamiliar with these terms, here’s a quick guide:
PHP: The web programming language Wordpress is written in.
Apache: The web server that comes with Mac OS X.
MySQL: The web database system used by Wordpress.
Step 1: Installing PHP
Mac OS X comes with PHP out of the box but we’re going replace it with the most recent version. This will also give us access to some other technologies not supported on the default installation.
Choose a version of PHP based on your operating system and Download it.

Double click the Disk Image that was downloaded.

From the Mounted Disk, Double Click the Installer Package.

Choose the drive you want to install PHP in and install it. You need Administrator’s rights to perform this action.

Go to the Finder’s top menu and select Apple > System Preferences. Under Internet and Network, select Sharing. Under the Services Tab start Web Sharing by selecting Personal Web Sharing and clicking the Start button.

That’s it, PHP is installed! You can unmount the Mounted Disc from the Finder’s Sidebar and delete the Disk Image File.
Step 2: Installing MySQL
Go to the MySQL website and choose the Standard installer package based on your operating system. Download the file. Once downloaded, double click the DIsk Image.

From the newly mounted disk, double click the Installer Package.

Select a hard drive to install MySQL in and run the installer.

Once finished, go back to the content of the Mounted Disk and double click the MySQL to run the Installer.

Once finished, go back to the content of the Mounted Disk and double click the PrefPane to install the Preference Pane.

From the MySQL Preference Pane click on Start MySQL Server and select the Automatically Start MySQL Server on Startup option.

That’s it, MySQL is installed! You can unmount the Mounted Disc from the Finder’s Sidebar and delete the Disk Image File.
I got PHP and MySQL running, now what?
Point your browser to “http://localhost” without quotation marks. This should point you to your computer’s server located in your computer at /Library/WebServer/Documents. You can also do “http://localhost/~yourshortusername” to view your personal web site located in the Sites folder of your Home Directory.
Security: If you are concerned about anyone in your local network having access to your MySQL Database, password protect the root(master) user of MySQL by entering this in the Terminal Application “/usr/local/mysql/bin/mysqladmin -u root password new_password_here”.
On my next post, I’ll cover how to do local sub-domains and how to run WordPress Locally. In the meantime, you can check out PHPMyAdmin, a php script to manage MySQL databases if you want to play with both PHP and MySQL together. Your server address is “localhost” and your username is “root”.




Aug 22nd, 2005 at 10:24 pm
The tutorial is cool and useful for people needing to put all the pieces together but if you just want get to work or play and need mySQL and PHP and maybe Perl and phpMyAdmin and a whole bunch of other neat tools in one package then get xampp for Mac OS at http://www.apachefriends.org/en/xampp-macosx.html and skip most of the install stuff. Check it out if you haven’t, there are versions for Windoze, Linux and Mac. I’m running the Mac and Linux versions and would hate to go back to installing all these programs one at a time.
HTH
Dave
Aug 23rd, 2005 at 8:36 am
Thanks for that — while I’d have had no problem setting it up myself, I’ve been waiting ages for a MySQL control panel, so the heads up was much appreciated; I just had one of those momentary-glance-at-the-screenshot ‘ooh!’ moments.
Aug 23rd, 2005 at 8:52 am
It’s much easier to install MAMP - http://www.mamp.info/en/home/
That’s what I use for all web testing and Wordpress design projects.
“The abbreviation MAMP stands for: Macintosh, Apache, Mysql and PHP.
With just a few mouse-clicks, you can install Apache, PHP and MySQL for Mac OS X!”
Aug 23rd, 2005 at 2:44 pm
@katie : next time i should read also read part 1 (or better: the comments )before i post a comment to part 2 :) — sorry, said the same: MAMP
Aug 23rd, 2005 at 10:04 pm
Justa note… if you guys dont need THE latest MySQL, ServerLogistics(.com) offers a nice package installer that includes a prefpane capable of starting/stopping like MySQL’s own, but also the ability to initialize the databases and to change the root password all in the pane. The rest of their software is nice too, but hasnt been updated in quite a while (and the Apache2 installation wont work on 10.4). Hoping they will update it soon.
Aug 25th, 2005 at 9:33 am
Thank you, thank you, thank you! Just what I’ve been waiting for!
Nov 4th, 2005 at 11:09 am
hello…..
can anyone help me enter data into mysql database
from a flash form using coldfusion components ?
i’m using web services and simply want to pass data from my flash form to my cfc while staying in flash…
any actionscript (or coldfusion code ‘cfc’) that anyone could provide or even links to other ressources on this specific topic would be awesome…
if someone could help me with this process i would be greatful…..
thank you in advance…
Imran Hashmi
http://www.visionstudio.co.uk
Nov 8th, 2005 at 8:49 pm
hey mel, great tutorial. it’s about time i start tinkering around on my own test server rather than doing it live style. gracias. btw - my website is worth $14,000. I could panhandle and make more money in a year, then doing my website. go me.
Dec 30th, 2005 at 2:57 am
[...] 在mac上安装wordpress?当然可以,Melvin Rivera 手把手地叫你做。不仅如此,他还顺便教会我们让ichat 连上msn messenger。技术的美,尽情享用吧! [...]
Feb 21st, 2006 at 10:13 pm
[...] I followed the guides here at the All Forces WordPress installation tutorials. Everything was working fine, up until I changed the Permalink schema from http://footnoteblog.com/?p=000 URLs to something more human-friendly, such as: http://footnoteblog.com/welcome-to-my-blog. This was fixed by heading over to WordPress’ very extensive codex and digging up this entry, and this one: <Directory “/path/to/wordpress”> Options FollowSymLinks AllowOverride Options FileInfo </Directory> [...]
Feb 22nd, 2006 at 2:34 pm
[...] I followed the guides here at the All Forces WordPress installation tutorials. Everything was working fine, up until I changed the Permalink schema from http://footnoteblog.com/?p=000 URLs to something more human-friendly, such as: http://footnoteblog.com/welcome-to-my-blog. This was fixed by heading over to WordPress’ very extensive codex and digging up this entry, and this one: <Directory “/path/to/wordpress”> Options FollowSymLinks AllowOverride Options FileInfo </Directory> [...]
Jul 12th, 2006 at 7:30 am
Great walktthrough…
I did a successful installation of wordpress on my g4 notebook running 10.4.7.
Tried the same procedure on 10.4.7 server but the installer for php5 reports error in installation and I haven’t been able to start webserver since.
Anyone else face this problem? Any suggestions / solutions?
Thanks…
Sep 23rd, 2006 at 9:16 pm
Hi…. When I attempt to check my local host (the last step of this tutorial) it says a very big “FORBIDDEN you don’t have permission to access ~(myusername)/ on this server. Is this ok? can any one help me with this?
Nov 3rd, 2006 at 2:10 pm
the most simple is MAMP http://www.living-e.de/en/products/The-MAMP/download.php
Feb 17th, 2007 at 6:53 am
Is it possible to host WordPress blogs in iDisk ?
Apr 26th, 2008 at 8:10 am
[...] http://allforces.com/2005/08/22/wordpress-on-mac-phpandmysql/ [...]