Install ZEND Framework 2 on Your WAMP and XAMPP Server

I found some difficulties to setup Zend Framework 2.x in my localhost. You may found some difficulties in installing the zend framework 2.x like me, that’s why I have written this article, hope you will found find this article helpful.

  1. Download ZF2 skeleton app from GitHub https://github.com/zendframework/ZendSkeletonApplication as a  .zip  format

Install ZEND Framework 2 on Your WAMP and XAMPP Server

2. Extract your ZendSkeletonApplication-master.zip file to your  www directory and Rename the folder as your project name. In my localhost, it’s zf2crud.

3. Go to C:\wamp\bin\php\php5.3.5 or if you use xampp just go to C:\xampp\php and copies the folder path.

4. Right-click on My Computer inside your start-menu and click Properties,

5. Click Advanced tab inside System Properties.

6. Click “Environment Variables” Button and Select “Path” inside your “System variables” Sections. A new window will pop up once again

7. In the lower of the two boxes search for the variable Path and double-click it

8.  Leave everything as is and just EXTEND the variable by ” ;C:\wamp\bin\php\php5.3.5” or “;C:\xampp\php” (of course adjust your xampp/wamp directory)

9. Enable your php_openssl Module From your php.ini File

10. Hit ok, ok, ok, start a new CLI (!) and once again check what php -v returns. It should work now.

11. Go to your CLI , change the directory to the project directory. Write command “cd C:\wamp\www\zf2crud” or if you use xampp “cd C:\xampp\htdocs\zf2crud” and press enter

12. Now run “php composer.phar self-update” in your CLI

13. After Completing php composer.phar self update now run “php composer.phar install

READ  ZfcUser is a user registration and authentication module for Zend Framework 3

This will take a while to download and generate autoload files.

In that mean time, setup the virtual host. assuming that virtual host is zf2crud.localhost

14. Assuming that I’m going to setup a host named zf2crud.localhost and my host files are in C:\wamp\www\zf2crud\public

  1. Click WAMP icon on quick launch then Apache -> httpd.conf to open apache config file.

2. Go to bottom of the file and add following host settings.

1
2
3
4
5
6
7
8
9
10
11
<VirtualHost *:80>
ServerName zf2crud.localhost
DocumentRoot C:\wamp\www\zf2crud\public
SetEnv APPLICATION_ENV "development"
<Directory C:\wamp\www\zf2crud\public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
  • And also add this if you already do not have this, this will give access to the localhost as usual
1
2
3
4
5
6
7
8
9
10
11
<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>

For xampp settings Go to your xampp control panel click Config and open Apache (httpd.conf)

13. Open the windows host file. in my case, C:\WINDOWS\system32\drivers\etc and place

1
1
1
127.0.0.1 zf2crud.localhost

Finally go http://zf2crud.localhost/ to run your zend framework 2 demo

Leave a Reply

Your email address will not be published. Required fields are marked *