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)

 

11 Comments

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

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

    Reply

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

    Its fine man

    Reply

  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.

    Reply

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

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

    Reply

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

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

    Thanks.

    Reply

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

    How to install zend framework version 2.4.0?

    Reply

    • 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.

      PA

      Reply

  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?

    Reply

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

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

    Reply

  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.

    Reply

Express Yourself

*