• 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 975 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, 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

Get new posts by email:

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 (24.3K Followers)
  • Twitter (5.8k 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

  • What Online Casinos Have No Deposit Bonus in Australia March 30, 2023
  • Four Foolproof Tips To Never Run Out Of Blog Ideas For Your Website March 28, 2023
  • The Interactive Entertainment Serving as a Tech Proving Ground March 28, 2023
  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023

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, March 31, 2023, https://thecustomizewindows.com/2012/11/install-wordpress-on-mac-os-x-with-command-line-lamp-configuration/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT