Install Zend Framework on Windows

Zend Framework 1.11.10 version has the following Server Requirements:

  1. Apache server 2.2 (mod_rewrite or ISAPI_Rewrite) or later 
  2. PHP 5.3.8 (PEAR, PHPUnit, Xdebug) or later
  3. MYSQL 5.1 or later
  4. phpMyAdmin or a database manager

Download and Install Zend Framework

First of all you need to download the Zend Framework 1.11.10  from http://www.zend.com/community/downloads.

Create a new directory in your C:\Program Files\ drive, call ZendFramework.

Ectract .zip file to C:\Program Files\ZendFramework.

Go to the 'Start > My Computer > Properties'. Click on "Advanced system settings". Choose "Environment Variables" in the "System variables" and edit PATH. Add  ;C:\Program Files\ZendFramework\bin to the end of the rules and press OK. Reboot your computer.

Open your DOS windows and enter the following commands:

zf show version 
Zend Framework Version 1.11.11

zf --help
this will display all the commands availables

Install Xdebug

Download and Install Xdebug 2.0.5 (or later) but Xdebug 2.1.2 (or later) is highly recommended. The VCx marker tells with which compiler the extension was built, and 'Non-thread-safe' whether ZTS was disabled. Those qualifiers need to match the PHP version you're using.

Create a PHP test file (phpinfo.php) with the following content:
<?php
           phpinfo();
?>

If you don't know which one you need, please refer to the custom installation instructions (open your webser by localhost/phpinfo.php, click the right mouse button and select view source, paste source code into the form). You should see following instructions:

  1.  Download php_xdebug-2.1.2-5.3-vc9.dll
  2. Move the downloaded file to C:\PHP\ext
  3. Edit 'C:\PHP\php.ini' and add the line:
    zend_extension = "C:\PHP\ext\php_xdebug-2.1.2-5.3-vc9.dll"
  4. Restart your webserver (apache)

Open your phptest.php page by your browser and find the Zend Engine Logo, you will see on the left the following text:
Zend Engine v2.3.0, ...... Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans

Install PEAR and PHPUnit

We should install PEAR and PHPUnit  for the Zend Framework testing action. PHPUnit 3.6 requires PHP 5.2.7 (or later) but PHP 5.3.8 (or later) is highly recommended.

Pear Installation

  • Go to http://pear.php.net/go-pear.phar and save the file go-pear.phar in your C:/PHP directory
  • Open DOS windows and type the following lines:
    C:\cd PHP
    C:\PHP>php go-pear.phar


  • Checking if PEAR works:
    C:\PHP>pear
    Commands:
    build                  Build an Extension From C Source
    ....
  • C:\PHP>pear version
    PEAR Version: 1.9.4
    PHP Version: 5.3.8
    Zend Engine Version: 2.3.0
    Running on: Windows NT DELLPRCSN380 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586
  • Modifying C:/PHP/php.ini
    Open your DOS windows and to get  PEAR:
    C:/PHP>pear config-get php_dir 
    C:\PHP\pear
    Open your php.ini and copy this path to your php.ini "include_path":
    include_path=".;C:\php\pear\"
    Restart your apache

install PHPUnit

Open your DOS windows and go to php directory, and type the following lines:

  • pear config-set auto_discover 1
  • pear channel-update pear.php.net
  • pear upgrade-all
  • pear install phpunit/PHPUnit
  • pear install --alldeps phpunit/PHPUnit
  • pear list-channels (if there is zf channel) 
    pear channel-discover pear.zfcampus.org
    pear install zfcampus/zf

Verify zf command and Create zf Project

Go to your server document root (d:/www) by the DOS windows.

  • D:\www>zf show version
    Zend Framework Version: 1.11.10
  • zf create project zf-tutorial
    D:\www>zf create project zf-tutorial
    Creating project at D:/www/zf-tutorial
    Note: This command created a web project, for more information setting up your V
    HOST, please see docs/README

  • Go to your browser and type localhost/zf-tutorial/public, there is your new project (Zend Framework Welcome page) . It is now ready to develop this project for your wesite. 

[ERROR]

D:\www>zf show version
'".\php.exe"' is not recognized as an internal or external command,
operable program or batch file.

[SOLVED] many reasons:

  1. Check whether your C:/PHP has been added to "environment Variables PATH" 
  2. You forgot to add the ZendFramework/bin to the PATH variable.
  3. Space problem: remove any space in the PATH variable.
  4. Environment Variables, sequence problem:
    add your C:/Program Files/ZendFramework\bin  before the C:/PHP path.
  5. Verify whether you forgot semicolon (;) between variables.