官术网_书友最值得收藏!

Operating systems

This book will focus primarily on the Mac OS X Operating System (10.5 and later). While it's possible to develop applications with PHP and CouchDB on any operating system, I will be restricting most of my discussions to Mac OS X for simplicity and brevity. If you're using a Mac, you can skip ahead to the next section, titled Setting up your web development environment on Mac OS X.

If you're running Windows or Linux, don't worry! I'll give you some setup tips to get you started, and then you can take it from there. Again, it's worth noting that the command line statements that I use in this book are meant for use on a Mac OS. With that in mind, things such as navigating to your working directory, the location of files, and many more may not work as described.

Windows

If you're running Windows, there are a few easy steps you need to follow to get your machine up and running.

Installing Apache and PHP

You can simplify the setup of your Apache and PHP environment by using WAMP (http://www.wampserver.com/en/) or XAMPP (http://www.apachefriends.org/en/xampp.html). Both options make it incredibly easy for you to get Apache and PHP set up with just a few clicks of the mouse.

Installing Git

Git is available for every operating system. To install Git for Windows, navigate to Git's homepage (http://git-scm.com/), and click on the Windows icon.

Installing CouchDB

You can find more information on installing CouchDB for Windows using Apache's helpful install pages here: http://wiki.apache.org/couchdb/Installing_on_Windows.

Linux

It's difficult to standardize the install methods for Linux because there are many different flavors and configurations. But if you are using a generic distribution, such as Ubuntu, all of the required tools can be installed with just a few simple command line statements.

Installing Apache and PHP

apt-get is a powerful tool that we'll use to install applications and utilities in your system. Let's start by making sure that apt-get is up-to-date, by running the following command:

sudo apt-get update 

Let's make sure that we can host our PHP pages by installing Apache:

sudo apt-get install apache2 

Now that we have Apache, let's install PHP and a few other components needed to run the code in this book:

sudo apt-get install php5 php5-dev libapache2-mod-php5 php5-curl php5-mcrypt 

We have everything that is needed to host websites. So, let's restart Apache in order for our changes to take effect:

sudo /etc/init.d/apache2 restart 

Installing Git

We'll use Git for source control; luckily installing it is incredibly easy with the help of our friend, apt-git. Install Git by running the following command:

sudo apt-get install git-core 

Installing CouchDB

CouchDB is the database that we'll use through the course of this book. In this section, we'll install and start it using the command line.

  1. Install CouchDB with apt-get:
    sudo apt-get install couchDB 
    
  2. Start CouchDB as a service by running the following command:
    sudo /etc/init.d/couchdb start 
    

That was pretty easy, right? If you are using another Linux distribution, then you might have to do some research on how to get all of the required applications and tools installed.

Now that we got that out of the way, let's discuss the setup of a web development environment for Mac OS X.

主站蜘蛛池模板: 曲靖市| 县级市| 竹溪县| 景宁| 盐亭县| 泗洪县| 高唐县| 溧水县| 三门峡市| 富宁县| 天镇县| 武夷山市| 安龙县| 弥勒县| 商河县| 武山县| 青田县| 长葛市| 梅州市| 竹溪县| 绵阳市| 定南县| 芜湖县| 崇仁县| 驻马店市| 农安县| 大同县| 沈阳市| 长丰县| 新晃| 独山县| 汕尾市| 屯昌县| 南京市| 东乡族自治县| 莱州市| 中阳县| 康马县| 焦作市| 五原县| 广宗县|