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

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.

主站蜘蛛池模板: 平南县| 陆丰市| 淳化县| 云阳县| 嘉黎县| 大足县| 新野县| 章丘市| 徐闻县| 南汇区| 海伦市| 贵德县| 嘉义市| 资阳市| 南漳县| 武汉市| 樟树市| 托里县| 石景山区| 武汉市| 阳高县| 江孜县| 双城市| 会泽县| 阿城市| 洪雅县| 元氏县| 南漳县| 宜宾县| 治多县| 彭水| 淳安县| 保靖县| 海安县| 靖安县| 浦城县| 金阳县| 银川市| 高清| 任丘市| 包头市|