I spent a bit of time to find out the proper way of installing Zend framework 2 on my Local XAMPP (Windows system). Here I described the proper way what I found to install Zend framework 2 without any difficulty for you.
XAMPP is the most popular PHP development environment. XAMPP is a completely free, easy to install Apache distribution containing MySQL, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.
Zend Framework 2 is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 2 uses 100% object-oriented code and utilities most of the new features of PHP, namely namespaces, late static binding, lambda functions and closures.
Highlights in Zend Framework 2:
- An entirely re-written event-driven MVC layer
- Components practice dependency injection, supported by our Service Locator and DiC components
- A powerful module management system
- An EventManager, for writing event-driven systems, as well as for creating cut points in your software for introducing cross-cutting concerns.
- A new view layer, architected around analyzing the request and generating a suitable response, be it plain old HTML, or Atom feeds or JSON.

Step 1:
Zend framework 2 skeleton application is set up to use Composer to resolve its dependencies. Therefore, you need to install Composer if its not available in your system.
Composer installation procedure:
Download and run Composer setup executable file from: https://getcomposer.org/Composer-Setup.exe -it will install the latest composer version whenever it is executed.
During installation, please be careful to select php.exe (C:\xampp\php\php.exe) file from your current active PHP (i.e from XAMPP directory)
After installation, you can use ‘composer‘ command from any folder location.
Step 2:
Create your work directory under a XMAPP htdocs folder. C:\xampp\htdocs\zend
Step 3:
You need to create a new local domain to execute your project in a web browser. Open the local virtual host file C:\xampp\apache\conf\extra\httpd-vhosts.conf and insert the below lines
<VirtualHost *:80>
ServerName zf2.localhost
DocumentRoot C:\xampp\htdocs\zend\public
SetEnv APPLICATION_ENV “development”
<Directory C:\xampp\htdocs\zend\public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Step 4:
Configure local host file to activate above created virtue host domain. Open the host file C:\Windows\System32\drivers\etc\hosts and insert the below line
127.0.0.1 zf2.localhost
Step 5:
Open windows command prompt and navigate into your work directory


Now install Zend Framework 2 using the below command
composer create-project -s dev zendframework/skeleton-application C:\xampp\htdocs\zend

It will take a bit of time to finish this installation. Once installation started you will get notification updates as below:

Right click work directory and install composer ‘Composer Install‘ to rebuild with installed files.


Now Zend Framework 2 skeleton application created without Zend library files.
Download latest Zend Framework 2 from the link http://framework.zend.com/downloads/latest

Once downloaded latest package, Extract it. You will get 2 folders with the name ‘Zend’ and ‘ZendXml’.

Now copy those 2 folders into your work directory under the folder ‘library’. (You need to create ‘library’ folder under your work ‘zend’ folder)

that’s it. Now Zend Framework 2 installed successfully in your local XAMPP.
Open your web browser and call the below URL
http://zf2.localhost
You will get the below default page.

Now you can start to work on this Zend Framework 2 application.
In case any clarification during installation, feel free to contact me with the email ‘gtechhub@gmail.com‘.

Related Posts
-
Ubuntu upgrade / update package patch using apt-get installWe often install the required packages in our system / server based on our requirements and needs. Packages are maintained by the author or the organization who is offering this package, will release the new version or patch update in case of security upgrade and adding new features based on…
-
Generating Random String Using PHPGenerating random strings with custom specified length is most required functionality in every project. In this article, I described the easiest way to generate custom length random string. PHP program for Random String Generate: <?php /* * Function to generate random string * Default length 30 character */ function generateRandomString($length…
How to add and subtracting days using php date functionPHP date() function formats a local date and time, and returns the formatted date string. In this article, I described the simple process about how to add and subtract number of days from current date using default PHP date() function. Add number of days in current date: php strtotime add…
-
PHP: Create empty object - new stdClass,var_dumpstdClass is the default PHP object. stdClass has no properties, methods or parent. It does not support magic methods, and implements no interfaces. Standard way to create an "empty" object is: <?php $input_object = new stdClass(); var_dump($input_object); ?> Result for new stdClass(): object(stdClass)#1 (0) { } But, with PHP Version…
How to add and subtracting weeks using php date() functionPHP date() function formats a local date and time, and returns the formatted date string. In this article, I described the simple process about how to add and subtract number of weeks from current date using default PHP date() function. Add number of weeks in current date: (Example: adding 5 weeks) <?php…
Get the last element of an array in PHP – end()The end() function is an inbuilt function in PHP Programming. The purpose of this function is to find the last element of the given input array. The end() function changes the internal pointer of an array to the last element and returns the value of the last element. end() PHP…
-
PHP: How to copy all files from one directory to anotherI will guide you to copy all files & sub directories of the directory to another directory using PHP copy() function. There are many other functions used to copy the content of one directory to another. copy() Functionopendir() Functionis_dir() Functionscandir( ) Functionreaddir() Function PHP code for copy multiple files from…
PHP Cheat SheetPHP code is usually processed on a web server by a PHP interpreter implemented as a module, a daemon or as a Common Gateway Interface (CGI) executable. On a web server, the result of the interpreted and executed PHP code — which may be any type of data, such as…
How to add and subtracting months using php date() functionPHP date() function formats a local date & time, it returns the formatted string formatted date. In this article, I described the simple process about how to add and subtract number of months from the current date using default PHP date() function. Add number of months in current date: (Example:…
-
PHP: Convert JSON String to Array / Object using json_decodeHow to convert JSON String to Array / Object using json_decode? json_decode is inbuilt function in PHP. It will take a JSON string and converts it into a PHP array or object depends on arguments. Live demo: https://www.gtechhub.com/json-decode-online Convert JSON String to PHP Object: <?php $json_input = '{"array_key_1":"array_value_1","array_key_2":"array_value_2", "array_key_3":"array_value_3","array_key_4":"array_value_4","array_key_5":"array_value_5"}'; $json_result…