Get A Sys Admin

sysadmin linux open source centos redhat rhel ubuntu apache mysql amazon ec2 s3 tutorial

Oct 25, 2008

Zend Framework + SVN + ZF Tools on CentOS

This first part focuses on installing svn + zf library + zf tools on your dev server. In the second part (coming soon) I will show you how to create a svn repository and import into it a simple zf project created with zf tools.

Prerequisites:
You will need at least a working web server (Apache2) and PHP version 5.

I'll be using utterramblings repository to install subversion and required packages for the apache server.

Import the gpg key for utterramblings repository:
rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka


Add the repository to yum by creating a repo file in /etc/yum.repos.d/utterramblings.repo that contains the following lines:
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka


Install subversion and mod_dav_svn from utterramblings:
yum install subversion --enablerepo=utterramblings
yum install mod_dav_svn --enablerepo=utterramblings


You should have everything you need to start working with svn on your server.

Now let's install ZF tools to the server:
mkdir ZF_Tool
cd ZF_Tool/
svn checkout http://framework.zend.com/svn/framework/laboratory/Zend_Tool/ .


Now copy the directory 'library/ZendL' to a place that's in the include path of your php. In my case it was '/usr/share/php'.

Copy 'bin/zf.sh' and 'bin/zf.php' to /bin and edit zf.sh updating ZF_BIN_PHP variable to:
ZF_BIN_PHP=/bin/zf.php

Don't forget to change their permissions so anyone can use them:
chmod a+rx /bin/zf*


For ZF library I've used the minimal package since it contains most of the stuff I use anyway without being bloated. At the time of writing this article 1.6 was the latest version, which I've got it from their site using wget:
wget http://framework.zend.com/releases/ZendFramework-1.6.2/ZendFramework-1.6.2-minimal.tar.gz
tar zxvf ZendFramework-1.6.2-minimal.tar.gz


Copy the directory 'library/Zend' to the same place where you've put ZendL directory ('/usr/share/php' for me).

Now if everything went ok when you type at the cli 'zf show version' you should get something like 'Zend Framework Version: 1.6.2'.

Congratulations you are done with this part. If you want you can play around with 'zf create project' until I publish my next article showing how to use zf tools + SVN together to create the bases of a project.

Labels: , , , , , ,