Friday, 5 January 2018

How to install Zend Framework2 in Wamp Server window7?

How to install Zend Framework2 in Wamp Server

  1. Go to home directory of wamp (For Example: c://wamp/www
  2. Download composer (If not installed)
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    php composer-setup.php
    php -r "unlink('composer-setup.php');";
    
  3. Download the Zend Framework2
    php composer.phar create-project zendframework/skeleton-application zf2
    
    It will take few mins to download the zend framework.
  4. Copy the composer.phar to zf2 folder
    cp composer.phar zf2
    
  5. Go to zf2 directory
    cd zf2
    
  6. Virtual Host setup
    Add following code in Apache setup
    
    <virtualhost>
        DocumentRoot "D:\wamp\www\zf2\public"
        ServerName zf2.loc
        <directory public="" wamp="" www="" zf2="">
            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from all
        </directory>
    </virtualhost>