Install WordPress on Mac OS X With Command Line LAMP Configuration

Install WordPress on Mac OS X Without installing MAMP or AMPPS from Command Line just like we do for Ubuntu or any kind of Linux. Mac OS X Lion has Apache, PHP and virtual hosts. Mac OS X looks funky in front but it is actually UNIX, so it is quite obvious that it will take almost all commands like Linux. There is no need to install any third party software like MAMP, AMPSS etc. Extra software means extra load and when we can actually configure Mac OS X like a server to run WordPress as on localhost, why we will use those junks. You can actually run any PHP MySQL based softwares, this guide to Install WordPress on Mac OS X With Command Line is a prototype example.


Install WordPress on Mac OS X With Command Line : The Basics


Basically labeling it as LAMP will be wrong, the right will be UAMP – Unix Apache MySQL and PHP. We will use iTerm2 for this guide to Install WordPress on Mac OS X With Command Line. Apache, PHP is already installed on Mac, we just need to configure to Install WordPress on Mac OS X. There is vim, nano etc.text editors preinstalled as well. Basically the only needed software is MySQL. Basically its the Windows that is abnormal. UNIX, Linux and BSD basically takes almost same commands. There is minor variation from distro to distro, like yast for SUSE/openSUSE, yum for CentOS / REHL and so on.


Install WordPress on Mac OS X With Command Line : The Commands


Just like we said before in the linked article, First open Terminal (iTerm with Homebrew will not allow sudo in all commands), type :


It will ask for password, type it and hit Return key. You will be root user now.

Install WordPress on Mac OS X With Command Line

In the above screenshot, you can see, I have used nano text editor to configure the httpd.conf file. You can open with vi (vim) command too. You need to change permission (chmod) it to edit in vim :

Otherwise you will get a read only file in vi. But in that case you have to revert back again by using :

…after editing. That is why using nano is better option.
Uncomment these lines :

Uncomment means making the directives active by removing the hash (#) and a space before them. Save it. The Include lines are for enabling virtual host and httpd-ssl. If you do not want these extra advanced setup, you only can uncomment the LoadModule (for enabling PHP) thing.

Install WordPress on Mac OS X

Run the four commands like above like a blind :

I basically checked by going to the folder and listing (ls) them. As I do not have those folders. You will not have too, create them as I did above. Now restart Apache :

This is how to setup the php :

Open php.ini file by using :

Edit these lines and save it :

These are only PHP and Apache native part. If you put a simple php file in /Library/WebServer/Documents ; it will load fine if you point your browser to http://localhost/ or the localhost’s IP (

Now the remaining points are MySQL and some other PHP components. MySQL can be directly installed or you can use Homebrew to get MySQL running :

You can start MySQL server in either ways :


Change write-version-here to full version number. You can install PHPMyAdmin if you want, but probably there is no need.

Now installing the dependencies (you’ll need Homebrew package manager to be installed) :

Please enable mycript from /etc/php.ini (in the way we enabled PHP). It will be looking like “extension=/usr/local/Cellar/mcrypt-php/…”

Setting up Pear is important.


Open /etc/php.ini and change that include_path = to pointing towards /usr/lib/php/pear.

(check the version when you will install)

Now your work toinstall WordPress on Mac OS X is almost done. It is like a LAMP server. Download WordPress and put it in /Library/WebServer/Documents. You need to create a MySQL database, the commands will be like in normal server installation like we described here in the last steps.

Tagged With install wordpress osx , lamp wordpress osx

Follow the Author of this article :

Here’s what we’ve got for you which might like :

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Google+ or Twitter to join the conversation right now!

If you want to Advertise on our Article or want Business Partnership, you are invited to Contact us.

Contact Us