Chapter 1. Zend_Http_Server

Table of Contents

1.1. Introduction
1.1.1. Basic Usage

1.1. Introduction

Any good web application requires a good web server to allow its users to access it, package up all of the data that is to be communicated in each direction and start the application itself. The best web servers are incredibly powerful and flexible, but consequently very complicated.

The Zend Http Server tool is a simple web server intended to allow rapid debugging and testing of Zend Framework applications without the complication. By reducing power and flexibilty, Zend Http Server aims to be a simple solution that "just works".

1.1.1. Basic Usage

To start the server, type '/path/to/zend/framework/incubator/tools/http_server/server_start.php'

By default the server will assume that your current directory is the document root and it bind to port 8888 on the localhost IP address (127.0.0.1). This means that the server will only be accessible from the computer running the server. You would see your site by visiting http://localhost:8888/

If the computer that you are running the server on is different to the computer you would like to browse to it from, you will have to make the server bind it's external IP address.

The options to server-start.php are: -p port - bind to the specified port -h host - bind to the specified IP address -d document_root - set the document root --help - prints the usage options and the values of the port, host and document root that would have been used based on the other command line arguments --rewrite - Enables a default rewrite rule in the request handler. Sends all requests to /index.php unless the file extension is js, ico, gif, jpg, png or css. This is the basic rewrite rule needed to make a Zend Framework MVC app work

To stop the server, press Ctrl-C in the terminal window that the server is running in.