Book Image

Zend Framework 2.0 by Example: Beginner's Guide

By : Krishna Shasankar V
Book Image

Zend Framework 2.0 by Example: Beginner's Guide

By: Krishna Shasankar V

Overview of this book

<p>ZF2 is the latest update to the well-known Zend Framework. This version has considerably eased the process of building complex web applications with minimal development effort using plug and play components. ZF2 also provides a highly robust and scalable framework for developing web applications.</p> <p>"Zend Framework 2.0 by Example: Beginner’s Guide" will guide you through the process of developing powerful web applications using ZF2. It covers all aspects of Zend Framework application development right from installation and configuration; the tasks are designed in a way that readers can easily understand and use them to build their own applications with ease.</p> <p>"Zend Framework 2.0 by Example: Beginner’s Guide" begins with the basic installation and configuration of the Zend Framework. As you progress through the exercises, you will become thoroughly acquainted with ZF2. With this book, you will learn about the basic concepts of building solid MVC web applications using Zend Framework 2.0. The detailed step-by-step instructions will enable you to build functionality such as a group chat, a file &amp; media sharing service, search, and a simple store to name a few. You will also use a wide range of external modules to implement features that are not natively available. By the end of the book, you will be well versed in building complex, functionality-rich web applications using Zend Framework 2.0.</p> <p>"Zend Framework 2.0 by Example: Beginner’s Guide" provides everything that you need for building functionality-rich web applications with simple real world examples and tasks.</p>
Table of Contents (18 chapters)
Zend Framework 2.0 by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – installing Zend Server CE


Our next step will be to download and install Zend Server CE; I am running Ubuntu 12.04 Precise Pangolin. The installation procedure for other operating systems could be different; you can always refer to the Zend Server website for installation instructions. The following are the steps to 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 latest version of Zend Server that is applicable to your operating system. In this case, 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
    

    Note

    We are passing two parameters to the installer. The first one is the version of PHP that needs to be installed; in this case it is 5.3. The second parameter identifies the edition of Zend Server that needs to be installed; in this case it is ce for Community Edition.

  4. During the installation, the installer will request you 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 by /var/local/zend/etc/php.ini

    The following screenshot shows the installed location of Zend Server:

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

Tip

To restart Zend Server, use the $ sudo service zend-server restart command.

What just happened?

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

Have a go hero

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

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

Tip

Git binaries can either be downloaded from http://www.git-scm.com/ or installed from your operating system's repositories.

Installation instructions for Git can be found at the following link:

http://git-scm.com/book/en/Getting-Started-Installing-Git

Configuring Zend Server CE

Our next step will be to set up Zend Server CE and make some configuration changes that will enable us to run other PHP applications.

Zend Server CE – Administration Interface

Zend Server CE's Administration Interface is a web-based user interface that provides the following features:

  • Managing PHP extensions

  • Configuring PHP directives

  • Managing Zend Server components

  • Monitoring PHP status, extension status, and application/server logs

In our next task, we will be making a configuration change to Zend Server by using its Administration Interface.