Install Zend Framework on Fedora 16/15, CentOS/Red Hat (RHEL) 6.2/5.7
This is quick guide, howto install Zend Framework (ZF) 1.11.11 on Fedora 16/15/14, CentOS 6.2/6.1/6/5.7 and Red Hat (RHEL) 6.2/6.1/6/5.7. 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.3 on Fedora, CentOS, Red Hat (RHEL)
Install Apache (httpd) and PHP 5.3 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.11.11 on Fedora 16/15/14, CentOS 6.2/6.1/6/5.7 and Red Hat (RHEL) 6.2/6.1/6/5.7
2.1 Change root user
su - ## OR ## sudo -i
2.2 Install Remi repository
Fedora
Currently extra repos are not needed on Fedora 16.
## Remi Dependency on Fedora 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 15 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-15.rpm ## Fedora 14 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm ## Fedora 13 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm ## Fedora 12 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-12.rpm ## Fedora 11 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-11.rpm ## Fedora 10 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-10.rpm ## Fedora 9 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-9.rpm ## Fedora 8 ## rpm -Uvh http://rpms.famillecollet.com/remi-release-8.rpm
CentOS and Red Hat (RHEL)
## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ## rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.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.11.11
Minimal setup
## Fedora 16 ## yum install php-ZendFramework ## Fedora 15/14, CentOS 6/5.7, Red Hat (RHEL) 6.1/6/5.7 ## yum --enablerepo=remi install php-ZendFramework
Install Zend Framework Full setup
## Fedora 16 ## yum install php-ZendFramework* --exclude php-ZendFramework-Db-Adapter-Oracle ## Fedora 15/14, CentOS 6/5.7, Red Hat (RHEL) 6.1/6/5.7 ## yum --enablerepo=remi install php-ZendFramework* --exclude php-ZendFramework-Db-Adapter-Oracle
Note:Zend Framework Oracle DB Adapter is excluded, because it needs Oracle dependencies that will not work without extra tweaking.
Custom setup
## Fedora 16 ## yum 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 ## Fedora 15/14, CentOS 6/5.7, Red Hat (RHEL) 6.1/6/5.7 ## 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:
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
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.11.11
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 Note: This command created a web project, for more information setting up your VHOST, please see docs/README
3.3 Create Link (symlink) / Copy Zend directory to your project directory
## 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 .
Note: If you use symlink method then Zend Framework is updated automatically all your projects with yum update.
3.4 Check test-project directory content
Should look like following (check also library/Zend):
test-project |-- 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 posts:
- Install Apache/PHP 5.3.10 on Fedora 16/15, CentOS/Red Hat (RHEL) 6.2/5.7
- LAMP on Fedora 16/15, CentOS/Red Hat (RHEL) 6.2/5.7 – (Linux, Apache, MySQL, PHP)
- Install Sun/Oracle Java JDK/JRE 7u4 on Fedora 16/15, CentOS/RHEL 6.2/5.8
- Install MySQL 5.5.24 on Fedora 16/15, CentOS/Red Hat (RHEL) 6.2/5.8
- Install Memcached on Fedora 16/15, CentOS/Red Hat (RHEL) 6.2/5.7
good tutorial.it helped me a lot…….Thanks………
Good one.It helped me
thanks bro.. ;-)
br
Thanks buddy it is a wonder for me…
Because i am not aware of this….
Thanks Again
i have tried to install zend-framework on our server, but failed
IP address of the server : 174.36.141.219
i have follow these steps :
step 1 :
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
step 2 :
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
step 3 :
yum –enablerepo=remi install php-ZendFramework* –exclude php-ZendFramework-Db-Adapter-Oracle
on executing this command i got errors
No package php-ZendFramework available.
Please guide
Hi Tusar,
It should work, try to run yum update first?
Then please post output of following command:
I just did the following:
Download Zend tar.gz from http://framework.zend.com/download/gdata
Extract (tar -zxvf Zend*.tgz)
mv ./ZendGdata-1.11.9/library/Zend /usr/share/php/
chmod -R apache:apache /usr/share/php/Zend
worked for me.
Such a great tutorial. It helped me a lot… Thank you JR
I have followed this to the letter. But when I run any zf command, i get a ZF error saying path not found. I have triple checked and added the path to my include_path but still it wound work.
How about a tutorial on how to install both zend framework and nginx?
Keep up the good work.
Logout!
hi,
After creating new project i got this error :
PHPUnit was not found in your include_path, therefore no testing actions will be created.
Can you explain me about this!!!!
Thank u
Hi rizvan,
It’s just notice that you don’t have PHPUnit on path / installed. Do you have php-ZendFramework-tests package installed?
HI, i’ve tried to install zend framework following this tutorial on a Centos 5 and it fuck up my mysql…. now have 4 clients production sites down!!
I have only ran 2 lines:
## 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
After this the normal :
yum –enablerepo=remi install php-ZendFramework
For some reason this lines include and update of mysql and now non of the sites can connect with mysql… the message says
PDOException: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in lock_may_be_available() (line 165 of /var/www/vhosts/baetica.es/httpdocs/includes/lock.inc).
I have checked this file ‘/var/lib/mysql/mysql.sock’ and is missing, and the “unwanted installation” of mysql did include a nice present… a new file my.cnf.rpmnew and some other files in this folder ending with .rpmnew
Now my mysql server do not even start.
Any help? I’m desperate!!
Hi Beto,
First of all, it’s very important check what is really happening, when you run any command at production server as root user. Normally best way is run test server and test changes there before you run any commands on production server and if you don’t want to run test server then full backups before changes are good choice.
Then your problem.
Is MySQL server running at all?
Could you connect to MySQL server on locally with mysql client using same hostname, username, password and dbname as your sites?
Could you connect to MySQL using ip 127.0.0.1 instead localhost?
Many Thanks Dear :-)
i have successfully installed zend-framework on my rhel 6
when i put url as,
http://localhost/myzend/pubic/
its working fine.
but if i put url as
http://localhost/myzend/pubic/index/
its not working. (it gives 404 error)
i have done all possible configuration.