Setup Zend on windows using WAMP Server

Download and install WAMP server from:

http://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.0/WampServer2.0i.exe/download or

http://www.wampserver.com/en/download.php

Download Zend Library code from:

http://framework.zend.com/download/latest

Add library of zend framework folder (downloaded from above link) to php ini’s include path

And now before we start using Command Line Interface (CLI) to create your project copy  zf.bat and zf.php files to php bin directory (c:\wamp\bin\php\phpx.x\ if wamp is installed on c:\wamp)

Next add php.exe to windows path [to add to windows path go my computer right click select properties and in system properties select advanced then select Environment variables browse path in system variables then click on edit then parse till the end insert a semi colon and path ‘;c:\wamp\bin\php\phpx.x’  after this go to cmd prompt and type php –help to check]

Go to cmd prompt and change the working directory to php bin directory [ cd  c:\wamp\bin\php\phpx.x\ ]

Run zf.bat create project <project_name>from current working directory this command will create your basic site structure, including your initial controllers and views. The folder tree looks like the following:

<project_name>

\application

\application\Bootstrap.php

\application\configs

\application\configs\application.ini

\application\controllers

\application\controllers\ErrorController.php

\application\controllers\IndexController.php

\application\models

\application\views

\application\views\helpers

\application\views\scripts

\application\views\scripts\error

\application\views\scripts\error\error.phtml

\application\views\scripts\index

\application\views\scripts\index\index.phtml

\library *

\public

\public\.htaccess

\public\index.php

\tests

\tests\application

\tests\application\bootstrap.php

\tests\library

\tests\library\bootstarp.php

\tests\phpunit.xml

*After creating your project copy the contents of zend framework library to <project name> /library folder

[copy  path/to/ZendFramework/library/Zend  and paste it in /library]

Change document root and directory settings of wamp server to <project_name>\public folder in httpd.conf file

And add your mysql connection details to <project_name>\application\configs\application.ini

resources.db.adapter = PDO_MYSQL

resources.db.params.host = localhost

resources.db.params.username = <mysqlusername>

resources.db.params.password = <mysqlpassword>

resources.db.params.dbname = <mysqldb>

and you are done restart wamp server and start coding your project.

Happy Coding

For more info visit:

http://framework.zend.com/manual/en/learning.quickstart.create-project.html

For help on CLI

http://framework.zend.com/manual/en/zend.tool.framework.clitool.html#zend.tool.framework.clitool.setup-general

Bookmark and Share

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Connect with us

Twitter  Facebook  Linked in  You tube  Myspace  Flickr  Slideshare