简体   繁体   中英

Best Way to Install Zend Framework 2

I'm new to the Zend Framework but have used PHP in the past. I've gone through the basic tutorial provided by Zend, and understand a lot of it, but I'm fuzzy on the installation process. There seems to be many different ways to install, is that right? Here are the ways I've seen:

  1. Download .zip file and manually extract
  2. Use command line with composer.phar
  3. Use command line with zftool

If someone could give a brief explanation of each of those above methods, how they differ, and which one is better, that would be great!

Also, two more quick questions on topic:

  1. The tutorial mentions including Zend in your PHP include path. Why would you need to do this if the framework is included in the projects directory?
  2. Is there a way to install the framework without the skeleton app?

Thanks in advance!

I'll only go about the 2nd set of questions:

  1. You don't. You either have it inside your include path or inside your projects.
  2. php composer.phare require zendframework/zendframework 2.2.*

Your first question is rather opinionated and it heavily depends on your workflow. To quote some song lyrics:

Sei ying there is no special move that is best, it all depends, any move could be best, 
its up to you when the times right, to move correctly, accurately and with great speed...

tl/dr choose the method that seems most practical to your solution.

Try this website: http://www.packtpub.com/article/building-your-first-zend-framework-application

It shows how to install, add a virtual host and skeleton application and add modules to that application.

Happy learning

Use Zip if you dont have access to other methods (composer or git). With Zip you wont be able (easily) to upgrade or downgrade components.

composer is great because you can configure your needs. for example:

"require": {
    "zendframework/zend-config": "2.2.*",
    "zendframework/zend-http": "2.2.*"
},

More info: http://framework.zend.com/downloads/composer

Use Git if you wish to be on the edge (more hard to maintain versions)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM