• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Install WordPress on Mac OS X With Command Line LAMP Configuration

By Abhishek Ghosh November 25, 2012 2:40 pm Updated on November 25, 2012

Install WordPress on Mac OS X With Command Line LAMP Configuration

Advertisement

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 :

Advertisement

---

 

Vim
1
sudo su

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

Vim
1
sudo nano /etc/apache2/httpd.conf

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 :

Vim
1
sudo chmod u+w /etc/apache2/httpd.conf

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

Vim
1
sudo chmod u-w /etc/apache2/httpd.conf

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

Vim
1
2
3
LoadModule php5_module libexec/apache2/libphp5.so
Include /private/etc/apache2/extra/httpd-vhosts.conf
Include /private/etc/apache2/extra/httpd-ssl.conf

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 :

Vim
1
sudo mkdir /usr/local/include

Vim
1
sudo mkdir /usr/local/bin

Vim
1
sudo mkdir /usr/local/lib

Vim
1
sudo mkdir -p /usr/local/man/man1

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 :

Vim
1
sudo apachectl restart

This is how to setup the php :

Vim
1
cd /etc

Vim
1
sudo cp php.ini.default php.ini

Vim
1
sudo chmod ug+w php.ini

Vim
1
sudo chgrp admin php.ini

Open php.ini file by using :

Vim
1
sudo nano /etc/php.ini

Edit these lines and save it :

Vim
1
error_reporting  =  E_ALL | E_STRICT

Vim
1
display_errors = On

Vim
1
html_errors = On

Vim
1
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626"

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 (127.0.0.1).

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 :

Vim
1
brew install mysql

Vim
1
unset TMPDIR

Vim
1
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

You can start MySQL server in either ways :

Vim
1
mysql.server start

 

Vim
1
/usr/local/Cellar/mysql/write-version-here/bin/mysql_secure_installation

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) :

Vim
1
brew install mcrypt mcrypt-php

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.

Vim
1
cd /usr/lib/php

 

Vim
1
sudo php install-pear-nozlib.phar

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

Vim
1
sudo pear channel-update pear.php.net

Vim
1
sudo pecl channel-update pecl.php.net

Vim
1
sudo pear upgrade-all

Vim
1
pear install MDB2-2.5.0b3

(check the version when you will install)

Vim
1
pear install MDB2_Driver_mysqli-1.5.0b3

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.

This Article Has Been Shared 974 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

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

Articles Related to Install WordPress on Mac OS X With Command Line LAMP Configuration

  • UNIX Operating System : Brief Technical Perspective

    UNIX Operating System is a multi-user operating system released in August 1969 by Bell Laboratories to support the development of softwares. Here is some words.

  • Installing Apache2 With PHP5 and MySQL Easy Guide

    Installing Apache2 With PHP5 and MySQL on Rackspace Cloud Server with Ubuntu Linux is written in easy language and as step by step guide for the newbies.

  • List of Indispensable OS X Commands

    List of Indispensable OS X Commands lists some important commands for the newbies to Apple Mac OS X 10.8 Lion. This is a small list of commands normally used.

  • Keyless Door Unlocking Mobile Cloud Based Apps : Gaining More Interest

    Keyless Door Unlocking Mobile Cloud Based Apps like Lockitron, ShareKey are growing interest from both the developers and the users. Let us have a deeper look.

  • Linux : Basics About Unix-like OS

    Linux referred to the usually free, unix-like Operating systems based on the Linux kernel and is GNU GPL based software. Licensing of the Linux kernel is under GNU GPL.

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 Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (21K Followers)
  • Twitter (5.3k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How Startups Can Convince the Investors April 14, 2021
  • What to Know About the Cloud Storage Services for Smartphones April 13, 2021
  • WonderFox HD Video Converter Factory Pro Review April 10, 2021
  • What is the Maximum Cable Length Between Arduino/ESP32 and a Sensor April 8, 2021
  • Is the Blockchain Hype Running Out of Breath? April 7, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Install WordPress on Mac OS X With Command Line LAMP Configuration," in The Customize Windows, November 25, 2012, April 16, 2021, https://thecustomizewindows.com/2012/11/install-wordpress-on-mac-os-x-with-command-line-lamp-configuration/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy