compared with
Current by Shahar Evron
on Oct 28, 2009 06:36.

(show comment)
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (99)

View Page History
h1. Installing Zend Framework on Windows
<h1>Installing Zend Framework on Windows</h1>

To install, [download the appropriate version|http://framework.zend.com/download] (most users will want the "Preview" release) and extract the .zip file to the directory of your choosing.
<p>To install, <a href="http://framework.zend.com/download">download the appropriate version</a> (most users will want the &quot;Preview&quot; release) and extract the .zip file to the directory of your choosing.</p>

<p>There are currently no installers that have been created for Zend Framework.</p>

For information on configuring a URL rewriting engine like Apache mod_rewrite or ISAPI_Rewrite for Microsoft IIS, see [$213].
<p>For information on configuring a URL rewriting engine like Apache mod_rewrite or ISAPI_Rewrite for Microsoft IIS, see <ac:link><ri:page ri:content-title="Configuring Your URL Rewriter" /></ac:link>.</p>

h2. Pre-built Packages
<h2>Pre-built Packages </h2>

h3. Zend Server or Zend Server Community Edition
<h3>Zend Server or Zend Server Community Edition</h3>

<p>You can have Zend Framework setup on Windows by installing [Zend <a href="http://www.zend.com/en/products/server-ce/index">Zend Server Community Edition|http://www.zend.com/en/products/server-ce/index], Edition</a>, which is available for free from Zend, and includes a PHP stack as well as the latest (or close to latest) version of Zend Framework, in one quick and easy installation.</p>

h2. Manual / Custom Installation
<h2>Manual / Custom Installation</h2>

h2. Preparation
<h2>Preparation</h2>

A <p>A minimal system for Zend framework includes PHP and a web server. Optional a database can be installed. This section includes different ways to create that environment.</p>

h3. Way 1 (Ala Carte)
<h3>Way 1 (Ala Carte)</h3>

h4. Webserver
* [Download|http://www.apache.org/dist/httpd/binaries/win32/apache_2.2.3-win32-x86-no_ssl.msi] and install the latest version of Apache
<h4>Webserver</h4>
<ul>
<li><a href="http://www.apache.org/dist/httpd/binaries/win32/apache_2.2.3-win32-x86-no_ssl.msi">Download</a> and install the latest version of Apache</li>
</ul>

h4. Optional if you need a database
* [Download|http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.27-win32.msi/from/pick#mirrors] and install the latest version of MySQL
* [Download|http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0-r6-win32.msi/from/pick#mirrors] and install the MySQL administration tools
** At this point it might be a good idea to verify that the MySQL installation is working by attempting to connect to it via the query browser (or whatever admin tool you decided to install), and create a simple database.

h4. PHP
* [Download|http://www.php.net/get/php-5.2.0-win32-installer.msi/from/a/mirror] and install the latest version of PHP
** The PHP installer will ask for the location of the Apache configuration directory. If Apache was installed to the default location, the configuration directory will be something like this: "C:\Program Files\Apache Software Foundation\Apache2.2\conf"
** The PHP installation process will update the Apache Configuration file (httpd.conf) and the MIMES file (mime.types) with the needed directives.
<h4>Optional if you need a database</h4>
<ul>
<li><a href="http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.27-win32.msi/from/pick#mirrors">Download</a> and install the latest version of MySQL</li>
<li><a href="http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0-r6-win32.msi/from/pick#mirrors">Download</a> and install the MySQL administration tools
<ul>
<li>At this point it might be a good idea to verify that the MySQL installation is working by attempting to connect to it via the query browser (or whatever admin tool you decided to install), and create a simple database.</li>
</ul>
</li>
</ul>

* If you have installed a mysql database
** Verify that there is a copy of libmysql.dll in the windows system directory, or some other directory that is in the system PATH. If needed it can be copied from the base directory of the PHP install.
** When running the PHP installer be sure to select the modules needed for your database. For MySQL you will need to select "MySQL" and "PDO/MySQL"

* After all Restart Apache to load the new PHP settings
<h4>PHP</h4>
<ul>
<li><a href="http://www.php.net/get/php-5.2.0-win32-installer.msi/from/a/mirror">Download</a> and install the latest version of PHP
<ul>
<li>The PHP installer will ask for the location of the Apache configuration directory. If Apache was installed to the default location, the configuration directory will be something like this: &quot;C:\Program Files\Apache Software Foundation\Apache2.2\conf&quot;</li>
<li>The PHP installation process will update the Apache Configuration file (httpd.conf) and the MIMES file (mime.types) with the needed directives.</li>
</ul>
</li>
</ul>

If it went as smoothly as it did for me this is all that needs to be done. As mentioned above, the only file that might need to be moved into place manually is the libmysql.dll.

h3. Way 2 (Simple)
<ul>
<li>If you have installed a mysql database
<ul>
<li>Verify that there is a copy of libmysql.dll in the windows system directory, or some other directory that is in the system PATH. If needed it can be copied from the base directory of the PHP install.</li>
<li>When running the PHP installer be sure to select the modules needed for your database. For MySQL you will need to select &quot;MySQL&quot; and &quot;PDO/MySQL&quot;</li>
</ul>
</li>
</ul>

* XAMPP [download here|http://www.apachefriends.org/de/xampp-windows.html]

XAMPP is a complete package for Windows (also avaiable for Linux and Co).
It has an installer with predefined configuration for a complete WebServer Environment.
* Apache 2.2.3
* PHP 5.2
* MySQL
* Zend Optimizer
* and a few more useful programs
<ul>
<li>After all Restart Apache to load the new PHP settings</li>
</ul>

Once downloaded and installed the system is ready to go.

h3. Way 3 (Simple)
<p>If it went as smoothly as it did for me this is all that needs to be done. As mentioned above, the only file that might need to be moved into place manually is the libmysql.dll.</p>

* WAMP [download here|http://www.wampserver.com/en/download.php]
<h3>Way 2 (Simple)</h3>

WAMP is another complete package (for Windows only) which also has a tray icon that allows you to manage the services. It's a complete installer with existing configuration for an \*AMP environment, plus managers for mysql and sqlite.
* Apache 2.0.58
* PHP 5.1.4 + PECL
* SQLitemanager
* MySQL 5.0.22
* Phpmyadmin
<ul>
<li>XAMPP <a href="http://www.apachefriends.org/de/xampp-windows.html">download here</a></li>
</ul>

Note: though XAMPP comes with PDO modules (Zend DBs preferred db adapters), only the sqlite and sqlite2 adapters are enabled. Modify the php.ini (C:\wamp\Apache2\bin\php.ini by default) to enable them.

h3. Way 4 (from Originals)
<p>XAMPP is a complete package for Windows (also avaiable for Linux and Co).<br />
It has an installer with predefined configuration for a complete WebServer Environment.</p>
<ul>
<li>Apache 2.2.3</li>
<li>PHP 5.2</li>
<li>MySQL</li>
<li>Zend Optimizer</li>
<li>and a few more useful programs</li>
</ul>

* Apache 2.2.3 [download here|http://httpd.apache.org/download.cgi]
* PHP 5.2.0 [download here|http://www.php.net/get/php-5.2.0-Win32.zip/from/a/mirror]

Install and configure them properly so they will work together.
* Apache and PHP Setup [look here|http://www.apachelounge.com/forum/viewtopic.php?t=570]
<p>Once downloaded and installed the system is ready to go.</p>

h3. Way 5 (Boosted)
<h3>Way 3 (Simple)</h3>

When you're in need of extended features from apache you might want to use this way which installs PHP 5.2 as module in Apache 2.2.3.
<ul>
<li>WAMP <a href="http://www.wampserver.com/en/download.php">download here</a></li>
</ul>

* Apache 2.2.3 with SSL and mod_deflate [download here|http://www.apachelounge.com/download/]
** Also several useful mods and extensions for Apache can be found here as
*** mod_security
*** mod_fcgid
*** mod_log_rotate
* PHP 5.2.0 [download here|http://www.php.net/get/php-5.2.0-Win32.zip/from/a/mirror]
** Install PHP be be used as Apache 2.2.x module
* Optimize Apache [look here|http://www.apachelounge.com/forum/viewtopic.php?t=274]
* Speed up PHP with APC [look here|http://www.apachelounge.com/article.php?op=Print&sid=67]

h3. Way 6 (Using Cygwin)
<p>WAMP is another complete package (for Windows only) which also has a tray icon that allows you to manage the services. It's a complete installer with existing configuration for an *AMP environment, plus managers for mysql and sqlite.</p>
<ul>
<li>Apache 2.0.58</li>
<li>PHP 5.1.4 + PECL</li>
<li>SQLitemanager</li>
<li>MySQL 5.0.22</li>
<li>Phpmyadmin</li>
</ul>

Download and [install Cygwin|http://www.cygwin.com/]. Select gcc, lighttpd, apache, libpcre, libjpeg, gd, zlib, libpng, sqlite, autoconf, libtool, make, etc. when choosing packages to download and install.

Note: If you already have installed Cygwin, make sure to first upgrade all installed packages before compiling PHP.
<p>Note: though XAMPP comes with PDO modules (Zend DBs preferred db adapters), only the sqlite and sqlite2 adapters are enabled. Modify the php.ini (C:\wamp\Apache2\bin\php.ini by default) to enable them.</p>

<h3>Way 4 (from Originals)</h3>
{code}
<ul>
<li>Apache 2.2.3 <a href="http://httpd.apache.org/download.cgi">download here</a></li>
<li>PHP 5.2.0 <a href="http://www.php.net/get/php-5.2.0-Win32.zip/from/a/mirror">download here</a></li>
</ul>


<p>Install and configure them properly so they will work together.</p>
<ul>
<li>Apache and PHP Setup <a href="http://www.apachelounge.com/forum/viewtopic.php?t=570">look here</a></li>
</ul>


<h3>Way 5 (Boosted)</h3>

<p>When you're in need of extended features from apache you might want to use this way which installs PHP 5.2 as module in Apache 2.2.3.</p>

<ul>
<li>Apache 2.2.3 with SSL and mod_deflate <a href="http://www.apachelounge.com/download/">download here</a>
<ul>
<li>Also several useful mods and extensions for Apache can be found here as
<ul>
<li>mod_security</li>
<li>mod_fcgid</li>
<li>mod_log_rotate</li>
</ul>
</li>
</ul>
</li>
<li>PHP 5.2.0 <a href="http://www.php.net/get/php-5.2.0-Win32.zip/from/a/mirror">download here</a>
<ul>
<li>Install PHP be be used as Apache 2.2.x module</li>
</ul>
</li>
<li>Optimize Apache <a href="http://www.apachelounge.com/forum/viewtopic.php?t=274">look here</a></li>
<li>Speed up PHP with APC <a href="http://www.apachelounge.com/article.php?op=Print&amp;sid=67">look here</a></li>
</ul>


<h3>Way 6 (Using Cygwin)</h3>

<p>Download and <a href="http://www.cygwin.com/">install Cygwin</a>. Select gcc, lighttpd, apache, libpcre, libjpeg, gd, zlib, libpng, sqlite, autoconf, libtool, make, etc. when choosing packages to download and install.</p>

<p>Note: If you already have installed Cygwin, make sure to first upgrade all installed packages before compiling PHP.</p>

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$ cat ./php-5.1.4/config.nice
#! /bin/sh
# These optimizations work for a Pentium-M CPU only!
exec ccache /usr/bin/gcc $* -Os -march=pentium-m -pipe -fomit-frame-pointer
{code}
]]></ac:plain-text-body></ac:macro>

Add ~/bin to your PATH in ~/.bashrc.
<p>Add ~/bin to your PATH in ~/.bashrc.</p>

Download PHP source, from www.php.net or even the latest 5.x.y from http://snaps.php.net.
<p>Download PHP source, from www.php.net or even the latest 5.x.y from <a class="external-link" href="http://snaps.php.net">http://snaps.php.net</a>.</p>

Then run ./php-5.1.4/config.nice
<p>Then run ./php-5.1.4/config.nice</p>

For lighttpd:
{code}
<p>For lighttpd:</p>
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
server.modules = (
"mod_rewrite",
)
setenv.add-environment = ( "TZ" => "PST8PDT" )
{code}
]]></ac:plain-text-body></ac:macro>

h2. Test PHP
<h2>Test PHP</h2>

<ol>
# Create <li>Create a simple file with the following code:
{code}
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
// file: phptest.php
<?php
phpinfo();
]]></ac:plain-text-body></ac:macro></li>
<li>Place it in your web-server root directory,</li>
<li>Enter the URL in your browser: <a class="external-link" href="http://localhost/phptest.php">http://localhost/phptest.php</a></li>
{code} </ol>
# Place it in your web-server root directory,
# Enter the URL in your browser: http://localhost/phptest.php


<ul>
* If <li>If there is no output or an error occurred, most likely something has been configured incorrectly. Check the PHP logs and the webserver logs. The location of these log files depends on the directives in the php.ini file and the httpd.conf (for the Apache web server). Typical locations of these configuration files, and the syntax of the directives would be something like this:
{noformat}
<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[
C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf

; Log errors to specified file.
error_log = "c:/www/logs/php.log"
]]></ac:plain-text-body></ac:macro></li>
{noformat} </ul>

h2. Rewriting URLs
See [ZFUSER:$213].

h2. Install The Zend Framework
<h2>Rewriting URLs</h2>
<p>See <ac:link><ri:page ri:content-title="Configuring Your URL Rewriter" /></ac:link>.</p>

Download and install the Zend_Framework
* [latest official Zend_Framework here|http://framework.zend.com/download/zip]
or play around with the
* [latest Developer Version of Zend_Framework|http://framework.zend.com/wiki/display/ZFDEV/Zend+Framework+Subversion+Standards]
<h2>Install The Zend Framework</h2>

Hints for starting with the Zend Framework can be found here
* [Official framework manual|http://framework.zend.com/manual]
* [PHP Architect Tutorial|http://hades.phparch.com/ceres/public/article/index.php/art::zend_framework::tutorial]
* [PHP Wiki|http://wiki.cc/php/Zend_Controller]
* [Zend Tips|http://devzone.zend.com/node/view/id/70]
* [Zend Tips 2|http://devzone.zend.com/public/view/tag/PHP%20Blueprint]
<p>Download and install the Zend_Framework</p>
<ul>
<li><a href="http://framework.zend.com/download/zip">latest official Zend_Framework here</a><br />
or play around with the</li>
<li><a href="http://framework.zend.com/wiki/display/ZFDEV/Zend+Framework+Subversion+Standards">latest Developer Version of Zend_Framework</a></li>
</ul>

h2. Debugging Install Issues

h4. "Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but not loaded' in ..."
<p>Hints for starting with the Zend Framework can be found here</p>
<ul>
<li><a href="http://framework.zend.com/manual">Official framework manual</a></li>
<li><a href="http://hades.phparch.com/ceres/public/article/index.php/art::zend_framework::tutorial">PHP Architect Tutorial</a></li>
<li><a href="http://wiki.cc/php/Zend_Controller">PHP Wiki</a></li>
<li><a href="http://devzone.zend.com/node/view/id/70">Zend Tips</a></li>
<li><a href="http://devzone.zend.com/public/view/tag/PHP%20Blueprint">Zend Tips 2</a></li>
</ul>


<h2>Debugging Install Issues</h2>

<h4>&quot;Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but not loaded' in ...&quot;</h4>

<ul>
* Make <li>Make sure that PDO is loaded in PHP. Make sure the .dll for the PDO extension is available to PHP (usually by dropping it into the 'ext' folder of your PHP installation and restarting your web server). If you don't have the PDO .dll, you can grab it off of [http://pecl4win.php.net/]. <a href="http://pecl4win.php.net/">http://pecl4win.php.net/</a>.</li>
</ul>