views:

304

answers:

2

I am using zend framework with windows XP and WAMP server.

I have created zend project using following DOS commands:

SET PATH=%PATH%;C:\wamp\bin\php\php5.3.0    
C:\>wamp\www> C:\wamp\www\ZendFramework\bin\zf.bat create project test

and my project is created at:

C:\wamp\www\test

Now I have two questions. Q.1: In which folder I will run my create controller zend command using DOS?

C:\wamp\www\test>
or
C:\wamp\www\test\application\controller>

Q:2 I have tried both above folder locations to run create controller command. I have following error. how to solve this?

COMMAND
C:\>wamp\www\test> C:\wamp\www\ZendFramework\bin\zf.bat create controller test

ERROR:
    Fatal Error: Cannot Redeclare class Zend_Loader in C:\wamp\www\test\library\Zend\Loader.php on line 31

Thanks

+1  A: 

Using xampp the procedure looks like this:

Create Project
working directory: htdocs

zf.bat create project zftest
cd zftest

Create module
working directory: htdocs/zftest

zf.bat create module testmodule

Create controller
working directory: htdocs/zftest

zf.bat create controller testcontroller index-action testmodule

Notice the working directory of each command

Xampp is an application stack for several different platforms, it's use is mainly to be able to setup a working development platform in a fast and effecient way.

The indexaction parameter is there to create a default index action in the created controller.

Peter Lindqvist
Thanks for your response. Your answer helped me about working directories. But I am getting same error mentioned in my question. I want to ask two questions related to your answer: 1. what is xampp? I am using only ZendFramework and DOS command line in WINXP. 2. In your third command(Create Controller) what is the purpose of 'index-action testmodule'. I am new to zend framework and your answer will help me.Thanks
NAVEED
See my edited answer. About the testmodul it's there to specify in which module to create the controller.
Peter Lindqvist
I got my answer for Fatal Error. See accepted answer. Your answer helped me about directory structure. Thanks
NAVEED
+2  A: 

See this related post. If you have copied the ZF framework to the C:\wammp\www\test\library folder then you will need to comment out this line in your test\application\configs\application.ini file so that the ZEND_LOADER class isn't included twice:

;includePaths.library = APPLICATION_PATH "/../library"

igotmumps
perfect. It is working now. Thanks
NAVEED
Cool. Glad I could help.
igotmumps