I am a php web application developer; I am working on WAMP 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.
- Download ZF2 skeleton app from GitHub https://github.com/zendframework/ZendSkeletonApplication as a .zip format
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”
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
- 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.
<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
<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
127.0.0.1 zf2crud.localhost
Finally go http://zf2crud.localhost/ to run your zend framework 2 demo
goodgood verygood 🙂
Install ZEND Framework 2 on Your WAMP and XAMPP Server
Hi, My name is Masud Alam, love to work with Open Source Technologies, living in Dhaka, Bangladesh. I’m a Certified Engineer on ZEND PHP 5.3, I served my first five years a number of leadership positions at Winux Soft Ltd, SSL Wireless Ltd, Canadian International Development Agency (CIDA), World Vision, Care Bangladesh, Helen Keller, US AID and MAX Group where I worked on ERP software and web development., but now i’m a founder and CEO of TechBeeo Software Company Ltd. I’m also a Course Instructor of ZCPE PHP 7 Certification and professional web development course at w3programmers Training Institute – a leading Training Institute in the country.
GoodGodd Onek valo hoise dekhi kisodin por try korbo… thanks
So nice of your post it is. Really helpful.
thanks, alot dear for such a concise and simple tutorial, it worked for me, thumbs up for your post
Thanks very much. This post is very helpful.
An excellent tutorial! I had to copy hosts file to another folder, make changes and then paste back. Also had to disable Avira’s protection of this file temporarily.
Wow man! very nice you saved my life yeah! i live in Brazil and i were searching in many places this help and i weren’t finding anything! you really helped me! thank you very much! Viva o php! =D
Good Good Very Good.
Will start soon ZF2.
i have followed the same path..
in the end i got XAMPP welcome page instead of zend framework 2..
Kindly can you help me to identify my mistake is this procedure.
Thanks
try like this in c:/windows/system32/drivers/etc
# 127.0.0.1 activate.adobe.com
127.0.0.1 zf2crud.localhost
may be its useful to you
Yeah! This is the best… It is exactly detailed.
WOW! Thanks dude!
Out standing – Much Appreciated.
Thank you mate.
You help me a lot
Fatal error: Uncaught exception ‘RuntimeException’ with message ‘Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.’ in F:\xampp\htdocs\zendcrud\init_autoloader.php:48 Stack trace: #0 F:\xampp\htdocs\zendcrud\public\index.php(9): require() #1 {main} thrown in F:\xampp\htdocs\zendcrud\init_autoloader.php on line 48
This is the error throwing while performing the said instructions in windows 7 xampp
This process is very hard :O
i use xampp 1.8.1 on Windows7.
is there any way that i can work with it easily?
need more tutorial on zend 2………………. please write sir…
Yes we web developer are looking for Zend framwork tutorial
It’s Very helpfull… And easy way to learn ..
but r koyekta tutorial dile valo hoto
After updating the hhtpd-conf file. I couldn’t access localhost
on accessing the localhost the zend default site opened. What will i do to enable localhost wamp page
Fatal error: Uncaught exception ‘RuntimeException’ with message ‘Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.’ in C:\xampp\htdocs\zf2crud\init_autoloader.php:48 Stack trace: #0 C:\xampp\htdocs\zf2crud\public\index.php(14): require() #1 {main} thrown in C:\xampp\htdocs\zf2crud\init_autoloader.php on line 48
Awesome tutorial to install zendframework2 using xampp
Thanks Masud.
Hello I did the same thing as you did in your tutorial but the following error:
address not found
Firefox can not find the server at http://www.zf2-tutorial.localhost.
Please check the syntax of the address
(entry ww.exemple.com instead of
http://www.exemple.com for example);
If you are unable to load any pages, check the connection
to network your computer;
If your computer or network is protected by a firewall or proxy,
make sure that Firefox is permitted to access the Web.
Thank you so much for your helpful tutorial
I successfully installed Zend framework on my localhost. Thanks for that. I need one more help. How to install ZFTool on zend 2. Please help this beginner if anyone know it.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
error occur after the change in the httpd.conf file
Appreciate such a detailed tutorial. I was struggling, and now it is fine.
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. error occur after the change in the httpd.conf file
nice once, clear and simple thanks !
Hi Masud vai how are you? I your your fan and one of the reader of this site. Now, I would like to learn Zend Framework.could you please help me?
Hi Masud,
Thank you for this step by step installation tutorial.
Thanks,
Bhupendra
I have installed the zend framework but it says
Access forbidden!
You don’t have permission to access the requested object. It is either read-protected or not readable by the server.
Error 403
localhost
11/19/13 10:45:38
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
Please Help
Thanks in Advance!!
First of all thanks for the tutorial, it’s great.
I have met the same access problem via using xampp.
I’ve solved the access problem by replacing the “C:\wamp\www\zf2crud\public” data in the etc/host file with “C:\xampp\htdocs\zf2crud\public”.
I hope it helps 😉
Sorry for the mistake, not in host file, in httpd.conf file.
Hello.. I have problem with compose.phar
Refer http://stackoverflow.com/questions/13120223/how-to-install-zend-framework-2-0-on-wamp
pl ,if you have “You must enable the openssl extension to download files via https” problem.
Thanks Dear. Great article!!!!!!!!!!!!
Just awesome!!!!!!!!!
Very usefull article! Thx!
Thank You!
HELP PLEASE
* I get following issues in step 12 php composer.phar install
[RuntimeException]
You must enable the openssl extension to download files via https
I tried all solutions here . http://stackoverflow.com/questions/14291151/you-must-enable-the-openssl-extension-to-download-files-via-https
But didn’t work
* In the last step the index.php in the WAMP folder is opened instead of the “Welcome to XendFramework 2”
Hi Din,
I was getting same issue. You can solve this by making changes in php.ini file…
I know you second question.. That you already did this but remember when we access php from command line it use another php.ini file which completely different from wamp.
You can find php.ini file at
C:\wamp\bin\php\php5.3.13
edit this file and allow https module…
Enjoy!!!!!!
Hello Developer
Greetings!
This is fantastic tutorials its real useful to developer.
Big thanks to you.
Thumbs up for this tutorials
Why ZF2 installation is like this??
9. Enable your php_openssl Module Using php.ini File…………I can’t get this point,plaease help me!!!
To enable openssl- 1. go to your xampp control panel
2.Click config of Apache 3. Find an cllick php( php.ini) from the list 4. Find out (Ctrl+f) ;extension=php_openssl.dll 5. Just remove the ” ; ” from the beginning. 6. Save , exit and restart your xampp. Hope you can now install ZF2.
For Vhost code – copy the code from here and just paste it at the bottom of that file. Keep in mind to save that file you have open that file as administrator. Thanks.
Hi, I’ve installed it on xampp but when I go to http://myZend.localhost/ it redirects me on http://myzend.localhost/xampp/ so I can’t use the framework. How can I get it?
Thanks for answers!
Please Check you .htaccess file and follow my article carefully
Hello!
I can access my vpshop.local correctly. But when I access only localhost it also takes me to Zend public/index.php page.
How can I access my xampp folder structure typing “localhost” on my browser?
Thanks!
You Should follow properly steps 14.1 and 14.2
Nice installation guide ….even zends own installation guide fails to explain it so nicely 🙂
Thanks for posting, it really helped me. Kudos to you.
Hello Guys,
Please tell me which method is best by using skelton or by using we also create a projects for the skelton installation process or simple download the zend framework , install and create project.
Thanks in advance.
Thanks and Regards,
HItesh
thank u very much. thanks a lot.
Nice and easy explain.
your students are lucky
very lucky
Great explained SIR.
Nice. It is very helpful.
Thanks for the post but when I tried installing zf2 as described above and when i try to access the page it says page not found. Can someone tell me why?
Easy steps to install Zend-Framework-2, Thanks a lot, Please mention one more line here -> Restart the apache server after all the steps.
Again Thanks to Masud for detailed steps.
Thanks
I have easily installed the zend in xampp.
All steps are given step by step
thanks again for the such post.
Thanks for this post. But I am getting this command “php_openssl” in php.ini, Please help me. I am using PHP Version 5.3.1 . Please reply am as soon as possible.
Thanks
plz enable your php_openssl extension in your php.ini file by removing ‘;’
i am getting error when i am installing composer :
failed to open stream : No connection could be made because the target machine actively refused it
Hi,
I am new to zend framework please reply query as soon as possible
I am getting this error when am installing composer the error is failed to open stream : No connection could be made because the target machine actively refused it.
Thanks
Man! Really did a great job.
thanks,good work.
i was fail to install zend framework from many days and finally i get success from this tutorial. thanks man .
keep sharing good work .
regards,
Muhammad Azam
Thank you so much.
hi when i write zf2crud.localhost then it is redirected to xampp.please help me i am not able to do it.
composer.phar not able to find this file???
Hi sir I have problem on Step 12.
I have run php composer.phar self-update but given below error.
could not open input file composer.phar
Even I have configure my php.ini file on following path
C:\wamp\bin\php\php5.4.16
Please help me.
Thank you.
Detailed post even for beginners, straight to the point. Thanks a million
Great!
Very good content for beginner