Wednesday 31 July 2013

Installing Zend Framework 2.0

All,

Here is a quick guide to do for installing your ZF 2.0 in Wamp


Step

1 Install wamp, only the x86 version because the latest version of php is already most recent on x86 with wamp (usefull or mendatory to use PHPUnit). After installation, activate rewrite_module @ wamp icon in the task bar > apache > modules
2 Go to wamp > bin > php > php version folder, open the file php.ini and uncomment one line, usefull for the command line with composer.phar and others .phar (don't use the icon wamp in the task bar, it's not the same effect, one is for php as module of the http server, this other php.ini is for php as php application, only this change work for cli request).
extension=php_openssl.dll
3 Download composer.phar http://getcomposer.org/
5 Download and install http://getcomposer.org/Composer-Setup.exe to fix the windows path environment OR you can add yourself, type "variable path" in the windows search, hit "...system...", click "Environment variables" in the (just opened) window, search "path" in the list, select, then click modify, and add @the end of the line: ;C:\wamp\bin\php\php5.4.16 (change the values for your good version and path).
6 Follow the instruction if you use the executable (the only one thing requested @ the installation is to match correctly the wamp directory of php.exe like wamp > bin > php > php version > php.exe)
remark: if you don't need extra install, you can define the variable path yourself or use all phar command in your shell with .\ before the.phar, and the command line run correctly
e.g.
cd c:/wamp/www
php .\composer.phar self-update
7 After downloading, put composer.phar and zftool.phar to the www directory of wamp
8 Go to > wamp > bin > apache > apache version > conf folder, open the file httpd.conf and uncomment the line
Include conf/extra/httpd-vhosts.conf
9 Download and install the github/shell @ http://windows.github.com/ (or another shell)
10 Start your Git shell or your shell
11 command line now...
cd c:/wamp/www
php zftool.phar create project c:/wamp/www/zf2
cd ./zf2
php composer.phar self-update
php composer.phar install
12 Go to > wamp > bin > apache > apache version > conf > extra folder, open the file httpd-vhosts.conf and add
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "c:/wamp/www"
    SetEnv APPLICATION_ENV "development"
    <Directory c:/wamp/www>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName zf2.localhost
    DocumentRoot "c:/wamp/www/zf2/public"
    SetEnv APPLICATION_ENV "development"
    <Directory c:/wamp/www/zf2/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
13 Open as administrator (right click) your text editor and open the file > windows > system32 > Drivers > etc > hosts and add the line
127.0.0.1   localhost
127.0.0.1   zf2.localhost localhost
14 Mendatory: Restart your computer OR console: ipconfig /flushdns + restart wamp
15 Start now your wamp server, open your browser and visit zf2.localhost - Welcome to Zend Framework 2 coders !
From now, it's a few step to start any project with zf2, just create the project with the step 11 (just choose another folder name) and also step 12 + 13 (just add a virtual host but just choose another folderpath name and another domain.localhost name)

No comments:

Post a Comment