Zend - Framework 1.11 - Create a new project

1) Dowload the Zend framework To easily create a new project with Zend framework we have to go until the bin/ directory of the framework package. 2) Once downloaded from the official website, go until this directory:

ZendFramework-1.11.3/bin/

In this directory we have the binaries for UNIX like and Windows OS, named respectively zf.sh and zf.bat. 3) Open a shell (this black screen you like so much) and write this:

$ zf.sh create project "/home/login/www/test"

or

$ zf.bat create project "C:/www/test"

Now our "test" project has been created. Open it and you will see all directories and files needed to start our first Zend project. 4) Go inside your Zend framework package downloaded before. Open it and go until the library/ directory. Inside you have one directory named Zend. It contains all the framework classes needed to use it. Let's copy this Zend directory into the new library/ directory created in our test project:

(YOUR PATH UNTIL)/www/test/library/

5) OK at this point we must configure our server settings. In this example I use the Apache HTTP server. We have to create a virtual host. First of all, you have to activate (decomment) this line on your http.conf file that is in the conf/ directory of your Apache server:

LoadModule vhost_alias_module modules/mod_vhost_alias.so

Let's open the virtual host config file named httpd.conf on UNIX like or httpd-vhosts.conf on Windows. Let's write this after what is already written in this file:

#We are testing our first Zend project
<VirtualHost *:80>
    ServerName testing
    DocumentRoot C:\www\test\public
#or for UNIX like: DocumentRoot /home/login/www/test/public
 
    SetEnv APPLICATION_ENV "development"
 
    <Directory test/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Save and quit.

6) Now let's modify the hosts file. This file is generally located in /etc/hosts on UNIX like system and C:\Windows\System32\drivers\etc on Windows OS. Open it and write it at the following:

127.0.0.1 testing

Save and quit.

7) Restart the server.

8) Open your favorite browser and write it as an address:

testing/

9) Well done you made it!

Interesting isn't it? cool

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.