Web Development on the Mac: Part 2 – MySQL

Installing MySQL on OS X can be as easy or as complex as you want it to be. On the complex side, since OS X is UNIX, you could install from source and build your own package. Or your could use the Homebrew package manager to install completely from the command line.

The easiest way to get MySQL installed on OS X is to use the packages built by MySQL. The packages are offered up in tarball or in DMG. Getting the DMG is going to give you the most ‘Mac’ like install. For the purpose of simplicity, this is the method we will use in this example. (more…)


Category: PHP,Tutorial,UNIX,Web Development

Web Development on the Mac: Part 1

Mac OS X has been my platform of choice for web developmet since the release of OS X 10.2. The UNIX underpinnings of the OS and the inclusion of Apache, PHP and other web technologies, coupled with other tools like Photoshop and an wide array of high quality text editors and IDEs make OS X a stellar platform for building websites and web applications.

This article will guide you through the many options you have in setting up a killer, comprehensive platform for building web apps. (more…)


Category: PHP,UNIX,Web Development

Updating WordPress on Mac OS X Server

About the only thing I miss about hosting my sites on a Linux webhost running Cpanel is the ability to auto update WordPress sites with one click. Granted, my experience with WordPress auto update is a mixed bag. When it works, it is all kinds of awesome. When it doesn’t, it leaves your site inaccessible while you figure out exactly what went wrong and how to fix it.

Since I’ve moved my webhosting to my own colocated Mac mini, I’ve missed the ease of auto updating my WordPress sistes. Downloading the latest WordPress update is such a pain, especially when you have to update several sites each time an update is released. Thankfully, with a little command line code, you can perform this action quite quickly and easily.

First start by SSHing in to your Mac OS X Server. Once in, you will use the ‘curl’ command to download the latest version of WordPress. Thankfully, WordPress keeps it’s latest version at the same URL regardless of version number, so once you make note of this URL, it shouldn’t change.

curl -O http://wordpress.org.latest.zip

Once the download is complete, unzip the archive.

unzip latest.zip

Then change your directory to the wordpress folder.

cd wordpress

Now, the final piece is to copy the files in the WordPress folder to the location of your WordPress install. When you do this, make sure you use the ‘-pr’ modifier for the copy command so the copy maintains permissions (-p) and is recursive (-r).

cp -pr * /Library/Webserver/Sites/your-website-name/.

That’s it. You’re done. One of the nice things about the *NIX copy command is that it won’t obliterate directories on the destination if they aren’t present in the source directory. So when you copy the wp-content to the new location, your themes and plugins are all left intact.

In our next tip, we’ll show you how to combine all of these steps in to one script and further automate it.


Category: PHP,Tutorial,UNIX,Wordpress

About the author

A user of Macs since they had silly names like Performa and Centris, Theodore Lee is a techie who prides himself on his vast knowledge of all things Apple. OS X Factor was started in 2001 (originally as macosxcentric), and continues to churn out tips, tutorials, reviews and commentary on the tech sector.