Home arrow PHP arrow Page 2 - The Zend Framework: an Introduction

Downloading and Installing the Zend Framework - PHP

In this second part of a four-part series on the MVC paradigm and the Zend framework, you'll learn what the framework can help you accomplish and how to install it. This article is excerpted from the chapter 25 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).

TABLE OF CONTENTS:
  1. The Zend Framework: an Introduction
  2. Downloading and Installing the Zend Framework
By: Apress Publishing
Rating: starstarstarstarstar / 2
September 09, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Proceed to http://framework.zend.com/download to download the latest stable version of the Zend Framework. There are three available options for retrieving the source code, including downloading zip and tar packages, or checking out the code from Zend's Subversion repository. Choose whichever option is most convenient for you, uncompress the code if you choose one of the former options, and move the library directory to a convenient location, within the PHP installation directory's includes directory, for instance. Only this library directory is relevant, so you can disregard all other files in the uncompressed package. Also, consider changing the library directory name to something very easy to reference, such as zfw.


Caution  The Zend Framework requires PHP 5.1.4 or newer.


Because the Zend Framework works by routing all requests through a single script, you'll also need to configure Apaches mod_rewrite module. Create an .htaccess file and place the following contents in it, saving the file to the document root:

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php


Note  Apache's mod_rewrite module is a powerful feature of Apache used to manipulate requested URLs. On Windows, mod_rewrite is disabled by default. To enable it, you'll need to open up httpd.conf and uncomment the line LoadModule rewrite_module modules/mod_rewrite.so, update the appropriate AllowOverride directive to allow .htaccess files to be used, and then restart the Apache server. See the Apache documentation for more information about this directive.


Finally, because you'll need to reference several Zend Framework components from within your application, and it's always wise to ensure maximum application portability, this directory should be directly accessible by appending it to the php.ini file's include_path directive. For example, on Linux this directive might look like this:

include_path = ".:/usr/local/lib/php/includes/zfw/"

On Windows this directive might look like this:

include_path = ".;c:\php\includes\zfw"

If you don't have control over the php.ini file, not to worry; you can place the following directive in the .htaccess file, which should reside in the server's document root:

php_value include_path ".:/usr/local/lib/php/includes/zfw/"

On Windows the directive might look like this:

php_value include_path "C:\php\includes\zfw"

The Zend Framework has been configured. If you added the include_path information to php.ini, you'll need to restart your Web server in order for the changes to take effect.

Please check back next week for the third part of this article.



 
 
>>> More PHP Articles          >>> More By Apress Publishing
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: