Installing a copy of Zend Server onto your localhost


Zend  is a very famous open source framework for PHP. It’s known for its MVC (Model View Controller) architecture.

Zend at Wiki

MVC at Wiki

Suppose you have a web server using Zend Framework and you want to migrate it to your localhost, just follow the steps to get your local copy working :
( I use Ubuntu 10.04 along with Apache2 )

  • Install Zend Framework from the Ubuntu repos. You would need the following packages : zend-framework, libzend-framework-php and zend-framework-bin. Others : just download the framework from here : http://www.zend.com/en/community/downloads. Zend_Tool is automatically installed. It is a command line utility which is very useful for creating projects, controllers, action etc . More about Zend_Tool here http://devzone.zend.com/article/3811
  • Now open a terminal and type “zf show version” . It should show the current version. This acts like a checkpoint.
  • Then create a project using “zf create project <project-name>”. You would notice that a directory by your ‘project-name’ has been created in your ‘www’ folder.
  • Open /etc/hosts with root access and insert a line :
    127.0.0.1  [your-name].localhost
    
  • Then go to /etc/apache2/sites-available and make a new file with the name [your-name].localhost and insert this :
    ServerName [your-name].localhost
    
       DocumentRoot [directory]
    
       SetEnv APPLICATION_ENV development
    
    DirectoryIndex index.php
    
           AllowOverride All
           Order allow,deny
           Allow from all
    

    Just remember to enter your directory in place of [directory] eg. My directory is “/home/kartik/www/testrun/public”. In my case “/home/kartik/www/” is my Document Root

  • Now type sudo a2ensite [your-name].localhost. This enables the virtual host
  • Now restart Apache by sudo /etc/init.d/apache2 restart
  • Now download all the files from the server and just copy them into your project folder. Replace all of them.
  • Insert this line into your index.php file inside the public directory :
    set_include_path(get_include_path().
    PATH_SEPARATOR.'/usr/share/php/libzend-framework-php');
    

    This includes the Zend Library.

  • Now open a browser and type ” http://[your-name].localhost . Your homepage should show up

Tada !! You just got your local copy working. Happy Debugging !!

References:
#zftalk on irc.freenode.net
Zend Framework

Comments as always are highly welcome. If anyone faces a problem, please leave it as a comment

Tags: , , , ,

This entry was posted on Friday, June 11th, 2010 at 3:06 pm and is filed under PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Installing a copy of Zend Server onto your localhost”

Harsh Manral June 12th, 2010 at 11:40 am

i dunno 2 much bout dis but i want 2 know about it …………… it seems sumthin interestin…

Leave a Reply