Thứ Năm, 24 tháng 4, 2014

Zend Framework 2.0 [Getting Started with Zend Framework 2.0]

The last major release of Zend Framework, which happened in 2007, was version 1.0; during the last five years, Zend Framework has undergone a lot of changes to be a successful PHP-based framework. But by merely updatingthe framework, Zend Framework has retained some of the issues thawere inherently present in Zend Framework 1.0.

Zend Framework 2.0 is an attempt to makZend Framework better brearchitecting the framework right from the core. Some of the kefeatures of Zend Framework 2.0 over its previous version are listed as follows:

        PHP 5.3 features such as namespaces and closures
        A modular application architecture
        Event manager
        Dependency Injection (DI)

We will geto know about implementing the nefeatures of Zend Framework 2.0 in the coming chapters.

In this chapter we will cover the installation and configuration of some of the prerequisites of Zend Framework 2.0. ZF2 can be installed on most PHP-enabled web servers that support PHP 5.3.3 or later.

We have used Zend Server Community Edition as our default web server; however, any other PHP stack that supports PHP 5.3.3 can be used. Alternatively, you can also download Apache and PHP separately and install PHP over Apache.

Introduction to Zend Server Community Edition (CE)


Zend Server Community Edition is the free version of the popular Zend Server stack. The Zend Server stack provides a pre-integrated PHP application stack thacould be used across development, testing, and production. This enables application developmenteams to have a consistent environment across all stages of development.

Zend Server CE also provides features such as Zend Optimizer+ for PHP bytecode caching and Zend Guarfor encoding files.

Zend Server CE – system requirements

Zend Server offers installerfor Windows, Mac OS X, and a universal installation packagcompatible with most Linux distributions.

More details on the installation requirements can be found ahttp://www.zend.com/en/ products/server/system-requirements.
Our nexstep will be to download and install Zend Server CE; I am running Ubuntu 12.04
Precise Pangolin. The installation procedurfor other operating systems could be different;
you can alwayrefer to the Zend Server websitfor installation instructions. The following
are the stepto install the Zend Server CE:

1. Visit the Zend Server Community Edition website (http://www.zend.com/en/ community/zend-server-ce) and download the latesversion of Zend Server that is applicable tyour operating system. In thiscase, we will be downloading the Linux installer.
2. Once the installer is downloaded, extract the contents of the installer to a temporary location:
$ tar -zxvf ZendServer-5.6.0-RepositoryInstaller-linux.tar.gz
 3. After extracting, the installer needs to be started with administrator privileges:
$ cd ZendServer-RepositoryInstaller-linux/
$ sudo ./install_zs.sh 5.3 ce
 4. During the installation, the installer will requesyou to download various packages:



5. Zend Server will be installed into /usr/local/zend by default; the default document root will point to /var/www. You can use the following files to make configuration changes to the Zend Server instance:
  •                Apache master configuration is available in /etc/apache2/apache2.conf
  •               PHP configuration is controlled b/var/local/zend/etc/php.ini

6. Once the installation is completed, you should be able to open http://localhost on your web browser. This should takyou to a test page like the one shown in the following screenshot:

What just happened?

Zend Server CE is installed and ready to be used. Nowe have a web server and a compatible version of PHP running—this satisfies the correquirements for running Zend Framework 2.0.

We will be using Git to check out Zend Framework from Github; one of the major changes thahappened to Zend Framework 2.0 is that the source control has changed from SVN to Git.

Your nextask will be to install Git. We will be making use of Git when we are setting up our Zend Framework project.

Không có nhận xét nào:

Đăng nhận xét