Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup First Application in Zend Framework 2

i am creating my first application in zf2. i followed Zend Offical website zf2 Skeleton Application.i have downloaded the skeleton app from github as in in the given link.when i extract it and put that in my folder and run it its showing this Fatal Error

 Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. 
 Run  `php composer.phar install` or define a ZF2_PATH environment variable.' in 
 D:\projects\zf2\zf2_app\init_autoloader.php:50 Stack trace: #0 D:\projects\zf2\zf2_app
 \public\index.php(9): require() #1 {main} thrown in D:\projects\zf2\zf2_app
 \init_autoloader.php on line 50

i dont know How to fix this??

and what about this?

To install Zend Framework 2 into our application we simply type:
  php composer.phar self-update
  php composer.phar install

where to type these commands? Help me with my first ZF2 app

like image 699
Virgo Avatar asked Oct 17 '12 15:10

Virgo


People also ask

How do you create a project in Zend Framework?

Open a terminal (in Windows, Start -> Run, and then use cmd). Navigate to a directory where you would like to start a project. Then, use the path to the appropriate script, and execute one of the following: % zf create project quickstart.

Which command is used to install Zend Framework 2?

The command: composer create-project -n -sdev zendframework/skeleton-application path/to/install always create a ZendFramework 3 app is their is a command to create a project of zendfrmaework 2.


2 Answers

You should open a cmd window and change directory to your project. You then need to type the following:

php composer.phar install

This will install all the library dependencies for the Zend Skeleton Application - ZF2 in this case.

like image 175
Rob Allen Avatar answered Oct 07 '22 12:10

Rob Allen


In addition to Rob Allens answer i have good responses so far from Windows User who have less experience with the command line.

You may find my blog helpful, too: Zend Framework 2 installation on Xampp for Windows

like image 31
Sam Avatar answered Oct 07 '22 11:10

Sam