Wednesday 19 April 2017

How to install Zend Framework 2 in wamp using composer?

How to install Zend Framework 2 in wamp using composer?

1. Download the composer


Go to php directory (Path:wamp\bin\php\php5.5.12) from where you can run the PHP commands.
In My Case, I goes to "D:\wamp\bin\php\php5.5.12" using cd commands.
Execute the following command.
php -r "readfile('https://getcomposer.org/installer');" | php



2. Download the Zend framework2 using composer.


You can set the path where you want to download the zf.
I have set the path to "D:/wamp/www/zf2", Please change this as per ur need.
Execute the following command.
php composer.phar create-project -sdev --repository-url="https://packages.zendframework.com" zendframework/skeleton-application "D:/wamp/www/zf2"
 


3. Virtual Host Setup


Add following code in httpd-vhosts.conf file.
My Local path: D:\wamp\bin\apache\apache2.4.9\conf\extra
<VirtualHost *:80>
    DocumentRoot "D:\wamp\www\zf2\public"
    ServerName zf2.loc
    <Directory "D:\wamp\www\zf2\public">
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>


Add following code in hosts file
My Local path is : C:\Windows\System32\drivers\etc
127.0.0.1       zf2.loc

4. ReStart wamp Server


4. Open http://zf2.loc/

It must working, if not please comment. We let u know the reason.