How to install Zend Framework 2 on XAMPP

zf2Hey guys, I spent quite a bit of time trying to find a proper way of how to install Zend Framework 2 on XAMPP. Here are my tips about how to tackle and get started with Zend Framework 2.

 

1)      Go to C:\xampp\apache\conf\extra and modify httpd-vhosts.conf

Insert lines like:

<VirtualHost *:80>

ServerName zf.localhost

DocumentRoot C:\xampp\htdocs\zf\public

#ErrorLog “logs/dummy-host2.example.com-error.log”

#CustomLog “logs/dummy-host2.example.com-access.log” common

SetEnv APPLICATION_ENV “development”

<Directory C:\xampp\htdocs\zf\public>

DirectoryIndex index.php

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

2)      Go to C:\Windows\System32\drivers\etc and modify the hosts file.

Since you are going to install Zend Framework on C:\xampp\htdocs\zf add the following line to the hosts file:

127.0.0.1 zf.localhost

 

*   You must repeat steps 1 and 2 for every Zend Framework project, just like in Joomla!!!

3)      Download the Zend Skeleton Application from http://framework.zend.com/manual/2.3/en/user-guide/skeleton-application.html

4)      Go to C:\xampp\htdocs\zf and unzip the Zend Skeleton Application there

5)      Open GitBash and go to C:\xampp\htdocs\zf and type the following three commands:

php composer.phar self-update

php composer.phar install

php composer.phar update

* As soon as you do that open the browser and write http://zf.localhost Remember: this is the name you added in the hosts file! (127.0.0.1 zf.localhost)

 

Join the Conversation

12 Comments

  1. a bit more detail on step 5 would be useful… i had to google around to install composer and add php to my path before i could run the commands.

  2. Excellent blog,
    It’s very helpful to me..Successfully install zendframwork2…

    Thanks.

  3. First of all thank you very much for this helpful article.

    Below commands didn’t worked for me.
    php composer.phar self-update
    php composer.phar install
    php composer.phar update

    So,I changed them like below and it worked.
    composer self-update
    composer install
    composer update

    Hope this will same someones time.

  4. First of all Thanks for your valuable post on zend installation. I follow all the steps. upto step 4 all is ok for me but from step 5: I use removing php as
    composer self-update
    composer install
    composer update
    and let me install

Leave a comment

Leave a Reply to hasanur rahman Cancel reply

Your email address will not be published. Required fields are marked *