Install Zend Framework on Fedora, CentOS/RHEL

This is quick guide, howto install Zend Framework (ZF) 1.12.3 on Fedora, CentOS and Red Hat (RHEL). This guide also works with older Fedora releases, like Fedora 13/12/11 and also with older CentOS/Red Hat RHEL 5 releases. I use Remi repository here because it’s updated more frequently than example Fedora’s own repositories.
What is Zend Framework?
Zend Framework is a simple, straightforward, open-source software framework for PHP 5 designed to eliminate the tedious details of coding and let you focus on the big picture. Its strength is in its highly-modular MVC design, making your code more reusable and easier to maintain.

1. Install Needed Web and Database Servers

1.1 Install Install Apache (httpd) and PHP 5.4 on Fedora, CentOS, Red Hat

Install Apache (httpd) and PHP 5.4 on Fedora, CentOS, Red Hat (RHEL)
This is minimum requirement, but you also might need Database server, like MySQL, check 1.2. Or you might need whole LAMP stack check 1.3.

1.2 Install MySQL 5.5 on Fedora, CentOS, Red Hat (RHEL)

Install MySQL 5.5 on Fedora, CentOS, Red Hat (RHEL)

1.3 Install the whole LAMP environment with following guide

LAMP (Linux/Apache/MySQL/PHP) on Fedora, CentOS Red Hat (RHEL)

2. Install Zend Framework 1.12.3 on Fedora, CentOS and Red Hat

2.1 Change root user

su -
## OR ##
sudo -i

2.2 Install Remi repository


## Remi Dependency on Fedora 18/17/16 ##
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

## Fedora 18 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm

## Fedora 17 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-17.rpm

## Fedora 16 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-16.rpm

## Fedora 15 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-15.rpm

CentOS and Red Hat (RHEL)

## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

## CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

## Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

## CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

2.3 Install Zend Framework 1.12.3

Minimal setup

## Fedora 18/17/16/15, CentOS 6.4/5.9, Red Hat (RHEL) 6.4/5.9 ##
yum --enablerepo=remi install php-ZendFramework

Install Zend Framework Full setup

## Fedora 18/17/16/15, CentOS 6.4/5.9, Red Hat (RHEL) 6.4/5.9 ##
yum --enablerepo=remi install php-ZendFramework* --exclude php-ZendFramework-Db-Adapter-Oracle --exclude php-ZendFramework-Db-Adapter-Pdo-Oci

[alert]Note:Zend Framework Oracle DB Adapter and Oracle PDO DB Adapter is excluded, because it needs Oracle dependencies that will not work without extra tweaking.[/alert]
Custom setup

## Fedora 18/17/16/15, CentOS 6.4/5.9, Red Hat (RHEL) 6.4/5.9 ##
yum --enablerepo=remi install php-ZendFramework 
php-ZendFramework-Cache-Backend-Memcached php-ZendFramework-Db-Adapter-Mysqli 
php-ZendFramework-Dojo php-ZendFramework-Feed  php-ZendFramework-Gdata 
php-ZendFramework-Pdf php-ZendFramework-Search-Lucene 
php-ZendFramework-Services php-ZendFramework-Soap php-ZendFramework-demos 
php-ZendFramework-extras php-ZendFramework-tests

Pick all needed components from following:

[info]php-ZendFramework: Leading open-source PHP framework
php-ZendFramework-Auth-Adapter-Ldap: Zend Framework LDAP Authentication Adapter
php-ZendFramework-Cache-Backend-Apc: Zend Framework APC cache backend
php-ZendFramework-Cache-Backend-Memcached: Zend Framework memcache cache backend
php-ZendFramework-Cache-Backend-Sqlite: Zend Framework sqlite back end
php-ZendFramework-Captcha: Zend Framework CAPTCHA component
php-ZendFramework-Db-Adapter-Firebird: Zend Framework database adapter for InterBase
php-ZendFramework-Db-Adapter-Mysqli: Zend Framework database adapter for mysqli
php-ZendFramework-Db-Adapter-Oracle: Zend Framework database adapter for Oracle
php-ZendFramework-Dojo: Zend Framework Dojo Toolkit integration component
php-ZendFramework-Feed: Live syndication feeds helper
php-ZendFramework-Gdata: Google Data APIs
php-ZendFramework-Ldap: Basic LDAP operations API
php-ZendFramework-Pdf: PDF file handling helper
php-ZendFramework-Search-Lucene: Apache Lucene engine PHP port
php-ZendFramework-Services: Web service APIs for a number of providers
php-ZendFramework-Soap: SOAP web services server part helper
php-ZendFramework-demos: Demos for the Zend Framework
php-ZendFramework-extras: Zend Framework Extras (ZendX)
php-ZendFramework-tests: Unit tests for the Zend Framework[/info]

3. Create New Zend test-project and Test That The Zend Framework is Working

3.1 Check zf command functionality and Zend Framework version

zf show version
Zend Framework Version: 1.12.3

3.2 Create new zend project

## Change to web directory ##
cd /var/www/html

## Create new Zend Framework project using zf command ##
zf create project test-project
Creating project at /var/www/html/test-project

[alert]Note: This command created a web project, for more information setting up your VHOST, please see docs/README[/alert]

## Change directory to /var/www/html/test-project/library ##
cd test-project/library
## OR ##
cd /var/www/html/test-project/library

## Symlink Zend Framework on library path ##
ln -s /usr/share/php/Zend .

## OR ##

## Copy Zend Framework on library path ##
cp -R /usr/share/php/Zend .

[alert]Note: If you use symlink method then Zend Framework is updated automatically all your projects with yum update.[/alert]

3.4 Check test-project directory content

Should look like following (check also library/Zend):

|-- 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/Zend
|-- public
|     `-- index.php
`-- tests
|-- application
|    `-- bootstrap.php
|-- library
|    `-- bootstrap.php
`-- phpunit.xml

16 directories, 11 files

3.5 Check index page on browser

Open following url http://localhost/test-project/public/ on your browser.


Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button