Install Zend Framework on Linux Ubuntu

Zend Framework is an open source, object oriented web application framework for PHP 5. Zend Framework is often called a "component library", because it has many loosely coupled components that you can use more or less independently. But Zend Framework also provides an advanced Model-View-Controller (MVC) implementation that can be used to establish a basic structure for your Zend Framework applications.

Features

Zend Framework features include

  • All components are fully object-oriented PHP 5 and are E_STRICT compliant
  • Use-at-will architecture with loosely coupled components and minimal interdependencies
  • Extensible MVC implementation supporting layouts and PHP-based templates by default
  • Support for multiple database systems and vendors, including MariaDB, MySQL, Oracle, IBM DB2, Microsoft SQL Server, PostgreSQL, SQLite, and Informix Dynamic Server
  • Email composition and delivery, retrieval via mbox, Maildir, POP3 and IMAP4
  • Flexible caching sub-system with support for many types of backends, such as memory or a file system.

Install LAMP

Zend Framework can be tested by creating test project, it should be placed under the document root of your web server. Web server might be Apache, Nginx and Lighttpd, for easy understanding used Apache as web server.

Here is the Step by Step guide to Installation LAMP ( Apache+MySQL+PHP ) on Ubuntu

Here is the Step by Step guide to Installation LNMP ( Nginx+MySQL+PHP ) on Ubuntu

Install Zend Framework

$ sudo apt-get install zend-framework

Confirm the installed version.

$ zf show version
Zend Framework Version: 1.11.11

Testing Zend project

In Apache /var/www is the default document root, so going to create test project on /var/www, go to the default document root of web server.

$ cd /var/www/

Create the test project called zftest.

$ zf create project zftest

You should get the above message after hitting Enter; if you get any error message like below, you required to install PHPUnit on your Linux Ubuntu.

PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 46

Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 46

PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='/usr/share/php/libzend-framework-php:.:/usr/share/php:/usr/share/pear') in /usr/share/php/PHPUnit/Autoload.php on line 46

Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='/usr/share/php/libzend-framework-php:.:/usr/share/php:/usr/share/pear') in /usr/share/php/PHPUnit/Autoload.php on line 46

Now we need to have the Zend Library files in the library directory under the created project (By default it's empty), go to the library directory.

$ cd zftest/library/

SymLink is the better option than copying the library files to library directory, because the library files will get update when we are installing the latest Zend Framework.

$ sudo ln -s /usr/share/php/libzend-framework-php/Zend/ .

Tree view of your project directory, see the library/Zend directory too.

$ tree
.
├── application
│   ├── Bootstrap.php
│   ├── configs
│   │   └── application.ini
│   ├── controllers
│   │   ├── ErrorController.php
│   │   └── IndexController.php
│   ├── models
│   └── views
│       ├── helpers
│       └── scripts
│           ├── error
│           │   └── error.phtml
│           └── index
│               └── index.phtml
├── docs
│   └── README.txt
├── library
│   └── Zend -> /usr/share/php/libzend-framework-php/Zend/
├── public
│   └── index.php
└── tests
    ├── application
    │   └── controllers
    │       └── IndexControllerTest.php
    ├── bootstrap.php
    └── phpunit.xml

16 directories, 11 files

Open up a web browser and navigate to http://localhost/zftest/public. Screen Shot of Test Project in Ubuntu 12.04.

Install Zend Framework on Linux Ubuntu

0.00 avg. rating (0% score) - 0 votes