Install Zend Framework 1.8 on Ubuntu with Zend_Tool

zendframework-ubuntu

One of new features in ZendFramework 1.8 is "Zend_Tool".
Zend_Tool
provides a command-line script that can be used to ease many common project related tasks like

  • setting up the project tree
  • add controllers
  • add actions (and related view scripts)
  • add model classes
  • etc.

This instruction will guideline you to install Zend Framework 1.8 on Ubuntu with Zend_Tool.
FYI my environment are:

  • Ubuntu 9.04 (Jaunty Jackalope)
  • Apache 2.2

  1. download ZendFramework minimal at http://zendframework.com/download/latest
    I use Zend Framework 1.8.3 that released on June 09, 2009. and keepfile at desktop
  2. extract compress file to /usr/local/ pangpond@Julius:~$ sudo tar --directory=/usr/local/ -xzvf ./Desktop/ZendFramework-1.8.3-minimal.tar.gz
  3. rename extracted folder to ZendFrameworkCli pangpond@Julius:~$ sudo mv /usr/local/ZendFramework-1.8.3-minimal /usr/local/ZendFrameworkCli
  4. open ~/.bashrc and uncomment following line pangpond@Julius:~$ sudo vim ~/.bashrc

    if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
    fi
  5. open ~/.bash_aliases to add alias then close terminal and open a new terminal window to take effect. pangpond@Julius:~$ sudo vim ~/.bash_aliases

    alias zf='/usr/local/ZendFrameworkCli/bin/zf.sh'
  6. now run zf command to check zf version pangpond@Julius:~$ zf show version
    Zend Framework Version: 1.8.3
  7. cd to your www root path and use zf create project projectname command to create project and tree (I create at store all project at ~/Sites)pangpond@Julius:~$ cd ~/Sites/
    pangpond@Julius:~/Sites$ zf create project zendframework
  8. copy all Zend library to project library path pangpond@Julius:~/Sites$ cp -R /usr/local/ZendFrameworkCli/library/Zend ~/Sites/zendframework/library/
  9. now I have to config virtualhost pangpond@Julius:~/Sites$ sudo vim /etc/apache2/sites-enabled/000-default

    ServerName zendframework
    DocumentRoot /home/pangpond/Sites/zendframework/public
    <Directory />
       Options FollowSymLinks
       AllowOverride All
    </Directory>
    <Directory /home/pangpond/Sites/zendframework/public/>
       Options Indexes FollowSymLinks MultiViews
       AllowOverride None
       Order allow,deny
       allow from all
    </Directory>
  10. restart apache to take effect pangpond@Julius:~/Sites$ sudo /etc/init.d/apache2 restart
  11. edit /etc/hosts file pangpond@Julius:~/Sites$ sudo vim /etc/hosts
    127.0.0.1 zendframework

and then enter http://zendframework in browser. If everything ok you will see welcome screen like this.
zendframework project mainpage

Responses

Anonymous's picture
Your post much

Your post much appreciate!
Note: i am not bot ;P

Anonymous's picture
Hi, I could do till step 5

Hi,

I could do till step 5 successfully, but the output of step 6 is as below:
/usr/local/ZendFrameworkCli/bin/zf.sh: 44: php: not found

Pls help me!!

Regards,
Srinivas

PangPond's picture
It's depend on Step

It's depend on Step 3.
Actually I rename ZendFramework-1.8.3-minimal to ZendFrameworkCli
and keep that folder to /usr/local/

like
from : /usr/local/ZendFramework-1.8.3-minimal
to : /usr/local/ZendFrameworkCli

Anonymous's picture
Hi, I did the same, changed

Hi,

I did the same, changed to ZendFrameworkCli and the error message is also reflecting this in it.
Any other inputs pls... It's still not working and showing the same message.

Regards,
Srinivas

PangPond's picture
Umm.. I think maybe coz your

Umm.. I think maybe coz your download file not work.
If not found bin/zf.sh in your download package.
try to download it again at http://www.zend.com/community/downloads
***choose Zend Framework 1.8 minimal from a list, It's not Zend Framework 1.8 full

Anonymous's picture
I've found the same problem,

I've found the same problem, too. I tried to open /usr/local/ZendFrameworkCli/bin/zf.sh it and found this line

# find php: pear first, command -v second, straight up php lastly.

Correct it by do install php-pear first and make sure the file /usr/local/ZendFrameworkCli/bin/zf.sh was can execute.

เจอ error นี้ต้องลง php-pear ก่อนนะจ๊ะ

sudo aptitude install php-pear

Anonymous's picture
ใส่ alias

ใส่ alias zf='/usr/local/ZendFrameworkCli/bin/zf.sh' ลงไปใน .bashrc เลยก็ได้แถวๆ alias ด้านล่าง ง่ายดี

Anonymous's picture
zf create project

zf create project ramique.com

USEFUL HELP Ramique.Com started !!!!!!