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/”

#CustomLog “logs/” common

SetEnv APPLICATION_ENV “development”

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

DirectoryIndex index.php

AllowOverride All

Order allow,deny

Allow from all



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: 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

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! ( zf.localhost)



  1. kamatchi
    Feb 04, 2015 @ 05:26:52

    Excellent blog,
    It’s very helpful to me
    Thanks guy.


  2. panagiotis
    Feb 04, 2015 @ 13:01:56

    Its fine man


  3. jonathan
    Mar 17, 2015 @ 15:47:32

    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.


  4. hasanur rahman
    May 04, 2015 @ 14:54:00

    thanks for writing about zend installation. thank you very much.


  5. Hemant Raghuvanshi
    Jun 16, 2015 @ 10:34:01

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



  6. Hemant Raghuvanshi
    Jun 16, 2015 @ 11:13:16

    How to install zend framework version 2.4.0?


    • panagiotis
      Jun 16, 2015 @ 11:34:55

      I will get back to you soon. Will check for 2.4.0. I think that the same principles will apply for it as well.



  7. Gozilla
    Jan 19, 2016 @ 09:06:05

    Thanks very helpful. I want to change the host to my domain name. What should I do?


  8. Harish Govekar
    Jun 20, 2016 @ 11:35:54

    For the last step when i type those commangs it says php command not found.


  9. Dinesh Belakare
    Jun 24, 2016 @ 09:41:36

    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.


Express Yourself