Web Development in the Cloud with Zend Framework

| April 5, 2013

Zend Framework 2 is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 2 uses 100% object-oriented code and utilizes most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures. It's a successful PHP framework with over 15 million downloads.

The component structure of Zend Framework 2 is unique; each component is designed with few dependencies on other components. ZF2 follows the solid object oriented design principle. This loosely coupled architecture allows developers to use whichever components they want. Zend guys call this a “use-at-will” design.


Zend framework helps in creating PHP web applications easily and with minimal hassle:

  • It is a framework that is known for its simplicity. It provides a PHP developer with a lightweight component library that offers as much as 80% functionality and even lets one to customize the remaining 20%.
  • Zend follows industry best practices and helps in generating quality codes. The components of Zend Framework are unit tested using PHP Unit and easily extended.
  • Zend framework is extremely flexible and it supports all the features of the latest version of PHP.
  • It allows web developers to develop and deliver very interactive web applications to their clients in a cost effective way and much more.

Let's get even more advantages using Zend for web development in the cloud!

Create an environment

1. Go to Jelastic.com and sign up if you haven't done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.

2. While in Jelastic dashboard, click the Create environment button.


3. In the Environment Topology dialog, pick Apache as your application server, specify your cloudlet limits and type your environment name, for example zendframework.


In a minute your environment will be successfully created.

Deploy application

1. We use simple skeleton application ZendFramework.zip . You can simply download this package for the further testing or get a working copy of this project by cloning the repository and using composer to install dependencies:

cd my/project/dir
git clone git://github.com/zendframework/ZendSkeletonApplication.git
cd ZendSkeletonApplication
php composer.phar install

2. Upload your Zend application zip package to the Deployment manager.


3. Deploy your package to the environment you have just created.


3. Click Config button for Apache.

4. Navigate to config -> httpd.conf file and enter the following strings

<VirtualHost *:80>
  ServerAdmin postmaster@dummy-host2.localhost
  DocumentRoot "/var/www/webroot/ROOT/public"
  ServerName website.jelastic.com
  ErrorLog logs/dummy-host.jelastic.com-error_log
  CustomLog logs/dummy-host.jelastic.com-access_log combined
 SetEnv APPLICATION_ENV "development"
<Directory /var/www/webroot/ROOT/public>
  DirectoryIndex index.php
  AllowOverride All
  Order allow,deny
  Allow from all

instead of:

<VirtualHost *:80>
 ServerAdmin webmaster@domain.com
   DocumentRoot /var/www/webroot/ROOT
   ServerName website.jelastic.com
   ServerAlias *
   ErrorLog logs/dummy-host.jelastic.com-error_log
   CustomLog logs/dummy-host.jelastic.com-access_log common

Note: Such a configuration is suitable for ROOT context only. If you use any other context then parameters DocumentRoot and Directory have to be changed to appropriate context name. For example:

5. Save the changes and restart the server in order to apply the new configurations.


Now you can open your application in a web browser.


Zend Framework is one of the frameworks aimed to provide their users with the best practices, and to give repeatable, reusable structures for the applications they built. As well as Jelastic it is based on simplicity. Don't waste your time developing with complicated frameworks or using proprietary cloud platforms, choose easy solutions!