Zend Framework 2 installation on Xampp for Windows

With the first release candidate of Zend Framework 2 about to be released, more and more developers are trying to get a first look at the framework. Since the installation routine and the starting point has changed quite a bit compared to version 1 of the framework, a lot of users – especially those windows based – have some troubles of getting started.

Update: While this tutorial still is very useful for the xampp folks I strongly suggest to take a look at my blogpost about “Setting up a development environment on Windows” which uses PHPs internal webserver. Much easier to handle!

In this tutorial i will cover the very low basics that you need to get a ZF2 site running on your localhost.

Installing Xampp for Windows

The very first step is to install xampp on your system. Most people have done this quite some time ago. However, you should know that for Zend Framework 2 you will require at least PHP version 5.3.3.

  • Go to apachefriends.org and download xampp (personally i choose the installer)
  • Install xampp to a different directory than C:\Program Files (I choose C:\xampp as an example throughout this post)
  • Start the xampp controll panel, the apache webserver and check in your browser if http://localhost is working

Access the PHP executable

Later, when using the composer.phar to install the framework, we will be required to access the php executable. When using the xampp installer this should have been done already. Check if the executable is accessible by doing the following

  • Start the Windows Command Line Interface (CLI)  (Start Menu > Type cmd > Hit enter > The cli should pop up)
  • Type php -v and hit enter
  • You should get information about your current PHP Version. As noted previously it should be at least PHP 5.3.3

Command php not found

If you have installed your webserver manually, you may receive the following error message when trying to run the php -v command:

If this happens it means Windows is unable to locate the php executable. In this case we simply need to add the executables folder to our environment.

  • Right-click on Computer inside your start-menu and click Properties
  • Click Advanced system settings inside the left panel. A new window System Properties (Tab: Advanced) should pop up
  • Click Environment Variables. A new window will pop up once again.
  • In the lower of the two boxes search for the variable Path and double-click it
  • Leave everything as is and just EXTEND the variable by ;C:\xampp\php (of course adjust your xampp directory)
  • Hit ok, ok, ok, start a new CLI (!) and once again check what php -v returns. It should work now.

Installing GIT

The next thing in line to do is installing git on your system. GIT and Windows can be a tricky thing if you want to do extended stuff, but for the basics we just need to get access to the git command for our CLI. There are several options out there what to install, be it a GUI or just some CLI stuff. Just to name a few:

Personally for the few things i do with git, i run with msysGit. Just download the installer from Google Code run, the installer and put it on any directory you like.

After installing go to the directory and run either git-cmd.bat or msys.bat. Both will start a new CLI and you’ll be able to run the git command. Try by running git –version and you should get the wanted information. In case of an error check the installation manual, but there shouldn’t really be any.

More comfort

If you don’t want to run git-cmd.bat each time you may as well add the msysGit\bin folder to your PATH environment variable. This is done the same way we just added php to our environment variables above. After that the git command will be available in all your system CLIs.

Downloading ZendSkeletonApplication

Now that we have the system requirements for a zend framework application in place, the best way to start off is by downloading / cloning the ZendSkeletonApplication. For this we will use Git. It can be done without, but for future works it is highly recommended for every developer to slowly start using git and getting familiar with it (that’s on my todo-list, too).

You find the ZendSkeletonApplication on Github. With all the instructions needed, i will cover them again though.

  • Start a Git compatible CLI
  • Move to the directory you want to have the Zend application inside. Example: C:\xampp\htdocs. You move be using the cli command cd (change dir).
  • Run the following git command:

You can leave the <OptionalFolderName> blank obviously. If you do leave it blank the folder for your project will be named ZendSkeletonApplication. For most use-cases however you would want some kind of real name. So if you want your project to be named weblog, you’d run the following command:

Troubleshooting connection to git

One of the most common problems with git failing to pull the sources is those of blocked ports and proxy-servers. The error message containing fatal:unable to connect to github.com implies that the default port for using git is blocked. The things to do here is to simply use different protocols to grab the git sources! Go with one of the following commands and try again:

Working behind a proxy server

When working behind a proxy server, most commonly at work spaces, can result to some errors, too. The only thing required here is to set the system variable HTTP_PROXY to the proxy address of your use. Open the CLI and run the following command:

At some weird environments (ie my work place) you’ll be required to use it with the http-protocoll assignment. Don’t ask me why, it might fix things for you, too, though.

Missing write permissions on disk

Another uncommon problem on windows system is missing write permissions when pulling stuff from git. This is easily handled by simply running your CLI with administrator privileges.

Downloading Zend Framework

To conclude our little journey we will download the Zend Framework 2 itself. The recommended way to do so is by using the power of composer.phar. This file is located at your base directory of your ZendSkeletonApplication.

Be sure to run the following commands at a git compatible CLI and from the directory of your ZendSkeletonApplicatoin

This will take quite a while as the whole framework gets downloaded. Composer.phar basically is a container that does a couple of git commands for you. With this you will be able to download other optional dependencies (i.e.: Doctrine 2) very easily, too. More about this later though.

Configuring apache virtual host

The next step to get our ZendSkeletonApplication running is by configuring our apache vhost configuration. This is done by modifying the following file:

Add the following lines to the file, while ensuring you have the first line in there!

That’s it, restart your apache webserver and you’re good.

Accessing localhost

With aboves configuration we no longer have access to http://localhost. To be able to access the localhost we need to add another virtualhost named localhost.

Configuring Windows Hosts

The absolutely last thing is to modify the windows hosts file, so that whenever we access our virtual host via http://projectname.loc windows redirects this request to our webserver and not to the www. Open the following file:

Add this line

All set and done

With all this done, you should be ready to have the ZendSkeletonApplication running. Try to access projectname.loc from within your browser and hopefulle you will see the SkeletonApplication. If not, leave me a comment as apparently my little tutorial needs to get better!

I hope you enjoyed this, there is more to come!

Clip to Evernote
136 Responses to Zend Framework 2 installation on Xampp for Windows
  1. ravi Reply

    wow great tutorial thanks sam

  2. ana Reply

    Hi!! Just wanted to say THANKS! I’ve been trying to understand how this works for a few days untill I found this post. Works beatifully!

  3. Nishant Reply

    HI Sam first thank for nice tutorial ….
    i m follow your steps to install it works for basic localhost but when configure to virtual host(apache) it not works it redirects to xampp page.

    Plz help me out coz i m new and first time use zend

    Hope for reply ASAP…

    n Thnx once again

  4. victoria Reply

    hi Sam, Thanks for this great tutorial…i followed all the steps and it worked fine. But at the end when i checked on browser with http://projectname.loc, it gives error(“HTTP Error 404″).

    but if i checked with –http://localhost:8080/projectname/public/ then “Welcome to Zend Framework 2″ is showing.

    can you please tell me any reason?

  5. ramesh Reply

    E:\wamp\www\ZendSkeletonApplication>php composer.phar self-update
    Updating to version b580ad66a0242bd97b093eab46a331a17df08acd.
    Downloading: 100%
    Use composer self-update –rollback to return to version 7adc41d02c3536b3e19a6b9
    06cf0c4cf6d3beb70

    E:\wamp\www\ZendSkeletonApplication>php composer.phar install
    Loading composer repositories with package information
    Installing dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – Installation request for zendframework/zendframework 2.3.* -> satisfiable
    by zendframework/zendframework[2.3.0].
    – zendframework/zendframework 2.3.0 requires php >=5.3.23 -> no matching pac
    kage found.

    Potential causes:
    – A typo in the package name
    – The package is not available in a stable-enough version according to your min
    imum-stability setting
    see f
    or more details.

    Read for further common
    problems.

    help please

    • Sam Reply

      Hey there, please see my newest post which will be up in a few minutes. The installation routine has changed a bit over time and it’s much easier now ;)

  6. parvesh tandon Reply

    Thanks SAM for this valuable and time saving tutorial.

  7. Venkata Maniteja Reply

    I’m using Mac and can I install the same in Mac?

  8. vijaya Reply

    Hey.. Sam,

    It worked for me..
    Thanks a lot boy….

  9. Pablo Veiga Reply

    Hey,

    I set up the correct configuration as shown in this article but when I type only “localhost” it also takes me to zend project index page.

    Obs.: I’ve already created a virtual host named localhost but I can’t acces the xampp index page…
    I’d like to type “localhost” in the browser and see my htdocs folder structure.

    Thanks. Nica article.

  10. Amit Reply

    Hello Sam, I followed the tutorial and it works out fine. But I am not clear about one thing. Whenever I need to create a new project, do I need to create a Vhost entry and update the hosts file in windows?

    • Sam Reply

      late reply is late :D sorry about that.
      Well, it makes sense to add new vhost entries. You can set-up dynamic vhosts in apache, but windows will always needs its dedicated entries. The only dynamic solution would be to install your very own proxy server locally, but i feel that’s overkill. Best solution always would be to have a VM running linux :D

  11. Oke Reply

    Hi, thanks for the tutorial. I followed your tutorial step by step but when i typed projectname.loc it takes me to the xampp webpage. please help!

  12. Armando Reply

    Hi Sam. I followed your tutorial and end up with this error The download is corrupted (phar “D:\xampp\htdocs\project1\ZedSkeletonApplicaiton\composer-temp.phar” has a broken signature).
    Please re-run the self-update command to try again.

    I don’t know the root cause of error. Hoping you could help me thank you.

    • Sam Reply

      Can’t help you any more than the error message itself. try “php composer.phar self-update” again and see if it works. If not just re-download the skeletton and run self-update on that one. Maybe the dl was a bit corrupt…

  13. ramazan Reply

    Hi Sam,
    it’s great article thank you.

    I installed xampp latest version with apache 2.4.

    I have 403 error.

    in apache 2.4 there is a bit different config with virtual host directory permision.

    DocumentRoot “C:/xampp/htdocs/PROJECTNAME/public”
    ServerName http://www.projectname.loc
    ServerAlias projectname.loc

    DirectoryIndex index.php
    AllowOverride All
    #Order allow,deny ##apache 2.2
    #Allow from all ##apache 2.2
    Require all granted ##apache 2.4

    thank you again.

    • Sam Reply

      Thanks for the information. I haven’t come across any issues yet, but i will certainly check this out!

  14. varinder Reply

    Really very helpful form, really i love it, thanks Sam.

  15. learner Reply

    hi, could you please tell me how would it be possible to fix .htaccess without vhost (if its an online server) to access ‘myproject/’ instead of ‘myproject/public’ ? I’m trying that in localhost now but can’t fix it. my folder path is-

    localhost/myproject/
    -config
    -data
    -module
    -public
    -css
    -images
    -js
    -.htaccess
    -index.php
    -vendor
    -.htaccess
    -composer.json
    -composer.lock
    -composer.phar
    -init_autoloader.php
    -LICENSE.txt
    -README.md

    • Sam Reply

      Hey, usually all you have to do is to tell your Hoster to route the requests into your /public folder. Simply contact your support staff :)

      • learner

        so is it impossible to solve this without using vhost (creating my own .htaccess in ‘myproject/’ folder only) ?

      • Sam

        I honestly can’t say. iirc it’s not that simple. It’s all about the proper routing, but I’m no server guy, sorry ;)

      • learner

        its ok, if you see that someday then try to post that here :)

  16. Webdevilopers Reply

    Is a certain configuration required to make php’s mail() function respectively Zend\Mail\Transport\Sendmail work on XAMPP installed on Windows?

    • Sam Reply

      Just google “xampp mail php” :S

  17. sami Reply

    Hi, Sam, My nick name is Sam, ha..ha…ha…
    A lot of thanks for this tutorial, but I have a problem,
    When, open index.php on browser(my location is zend/public)

    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\zend\init_autoloader.php:48 Stack trace: #0 C:\xampp\htdocs\zend\public\index.php(14): require() #1 {main} thrown in C:\xampp\htdocs\zend\init_autoloader.php on line 48

    • sami Reply

      oh… When i am php composer install then this type of error

      [Runtime Exception]
      You must enable the openssl extention to dwnload……

      this message

      • Sam

        Enabling the openssl extention should help :S php.ini

  18. Santosh Kumar Mohanty Reply

    When i type zendapplication.loc it opens the windows IIS server home page.. when i give entire path that is C:/xampp/htdocs/zendapplication/public then i can see the welcome to zend framework homepage.

  19. Sivabalan Reply

    I am using Zendframework 2.2.1. I want install ZFTool on zend 2. Can you please guide me to do this. Please

  20. ramsai Reply

    i have placed your code like virtual host and i changed the same in etc/hosts file but my apache is not starting . Can you tell me the reason where i went wrong

    • Sam Reply

      Check your appache error logs. It will reveal where your error lies. Otherwise, as long as you#re following the tutorial 100% like this, it works.

      • ramsai

        i am using xampp with Windows 7 , if i remove this from httpd-vhosts.conf.

        DocumentRoot “D:/xampp/htdocs/ZendFramework/”
        ServerName http://www.projectname.loc
        ServerAlias projectname.loc

        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all

        when i click apache button it is starting fine.
        Any solution for this

    • Niels Reply

      I had this problem too, i copy pasted the virtualhost stuff from the last part and there’s a small mistake in it: the first time the directory uses C: the second time E:, i changed E: into C: and after that it all worked :D

      • Sam

        Thanks for the catch!

  21. Nishant Reply

    I followed all steps, and installation went without any problem.
    At final steps, I replaced “projectname” with “mysite”
    I also made a public folder inside my htdocs/mysite/
    When I type http://mysite.loc/
    it shows me
    http://i44.tinypic.com/2ivd6ki.png

    If I am not wrong,it should have showed me welcome to Zend framework 2 Screen.

    • Sam Reply

      Probably some misconfiguration of the Webserver. All i can say tho is that you may want to follow this tutorial step by step. That way it’ll be all working ;)

  22. Pushpendra Reply

    [UnexpectedValueException]

    Xampp\htdocs\Zend_Folder\vendor\zendframework\zendframework\fkjsafh123139048sdfsf, is not a zip archive.

    • Sam Reply

      Usually this has something to do with a corrupt installation of composer. At least to my experience, maybe re-download composer and try updating again ;)

  23. Pushpendra Reply

    When run
    php composer.phar install
    An Run Time Error Occur

    [RuntimeException]

    You must enable the openssl extension to download files via Htttps

    • Sam Reply

      Just enable said extension in your php.ini

  24. Suman Reply

    Great tutorial…worked perfectly…

    Please set your virtual host properly. Put your proper path in httpd-vhosts.conf.

    I was getting 403 for wrong path for virtual host.

  25. prathyusha Reply

    I got error is 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

    how can i solve this

    • Mukoro Godwin Reply

      Open command cd to the site folder (assuming you are on window that would be c:\xampp\htdocs\yourfolder\) and then run this two command:-

      php composer.phar self-update
      php composer.phar install

  26. krishna Reply

    thank you sir
    http://i1297.photobucket.com/albums/ag35/krishna_das1/untitled2_zps90d1e782.png

    i took snap of my error

    i did all thing according to your instruction .. last of set i got error ,,, if you rectify i will you glad to you

    • Sam Reply

      Hey sounds to me like a temporary composer or github error. You can try running the composer update or composer install command using the additional tag --prefer-source=https://github.com/zendframework/ZendSkeletonApplication/archive/master.zip

      • krishna

        got it thanks a lot sir …. refer me some good ide for zf2 other then eclips pdt , netbeans

      • Sam

        There’s always PHPStorm and ZendStudio (whereas the later is Eclipse-based)

      • krishna

        thanks sir .. i will try phpstrom .. In future issue can i contact you ?

  27. Waqas Reply

    I have tried to configure zend 2 on wamp. I hope you could resolve the problem i am facing right now.

    I changed the vhosts file in apache of wamp server. But when i tried to access the URL

    in my case:
    http://www.weblog.loc (localhost page of wamp opened)

  28. Lex Luther Reply

    help me. i’m so confuse :( i did correctly when changed the path so i restart the cmd windows and type “php -v ” again but it still does not work. what is happen ?

    • Sam Reply

      Hey there Lex, all i can say is that when following the steps identically, then it works :S

  29. ogi Reply

    i am still confuse, i am beginner in php programming did yo have some tutorial like core php, object oriented programming and so on …….

  30. naveen Reply

    Dear, I followed the steps accordingly but i have faced one problem i.e

    Fatal error: Uncaught exception ‘Zend\ServiceManager\Exception\InvalidArgumentException’ with message ‘$initializer should be callable.’ in F:\xampp\htdocs\zf2\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php on line 366

    Please can you help me regarding that.

    • Sam Reply

      You most certainly did something different ;)
      By the sound of the error there was a Service Initializer defined that is no callable… But what exactly you did, no clue :|

  31. Hari Krishna Reply

    Hello

    I followed your instructions.i successfully installed.
    but when i run my application,it is not executed.
    http://www.firstapp.loc:8080 it redirects to http://www.firstapp.loc:8080/xampp

    when i run like http://www.firstapp.loc/ it shows : Unable to connect.

    Please help on this issue ASAP.

    Thanks
    Hari

    • Sam Reply

      Most likely an issue with your virtual host configuration. Double-Check that area.V-Host-Configuration and Windows Host file.

  32. Greg Reply

    Hello, I’ve used this tutorial to install ZF 2 with WAMP, since it’s still the best I’ve found. I got through all steps except I wasn’t sure how to change the Apache config appropriately. And I also didn’t find projectname.loc in my ZendSkeletonApplication folder, so that was confusing to me as to where that comes from. Please let me know if you think you can help me on either of these points. Great tutorial, nonetheless!

  33. David Reply

    Got through all steps just fine, but I’m having trouble modifying the hosts file. “Please check if the file is open in another location”

    I’ve tried closing all applications and I still get this error. Any idea what I need to do?

    • Sam Reply

      Two things come to mind. #1 Maybe try with an editor that has administrative privileges (unlikely) and #2 Some Anti-Virus-Protection tools (like norton, kaspersky, etc) may prevent the hosts file from being edited. (likeliest) Check options in such a case.

      • David

        got it. Thanks!

        awesome tutorial!

  34. flora Reply

    hi sam,

    can you give me an idea on how will i resolve this error?

    Fatal error: Uncaught exception ‘Zend\ServiceManager\Exception\InvalidArgumentException’ with message ‘Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.’ in C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php:302 Stack trace: #0 C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ServiceManager\Config.php(126): Zend\ServiceManager\ServiceManager->addAbstractFactory(‘Zend\Cache\Serv…’) #1 C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ModuleManager\Listener\ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager)) #2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent)) #3 C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(472): call_user_func(Array, Obje in C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php on line 302

    • Sam Reply

      Hey Flora, please open a post on stackoverflow.com with a little more surrounding context. The error message only implies that somewhere you’re providing a wrong alias for a dependency. Somewhere :)

      • sameer

        My autoloader error which came before following your steps is now resolved. Thank you, but now it says

        Fatal error: Uncaught exception ‘Zend\ServiceManager\Exception\InvalidArgumentException’ with message ‘Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.’ in C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php:302 Stack trace: #0 C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ServiceManager\Config.php(126): Zend\ServiceManager\ServiceManager->addAbstractFactory(‘Zend\Cache\Serv…’) #1 C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ModuleManager\Listener\ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager)) #2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent)) #3 C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(472): call_user_func(Array, Obje in C:\xampp\htdocs\zf2-tutorial\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php on line 302

  35. Georgiana Reply

    Thank you for this tutorial. It’s working for me ;)

  36. Jones Reply

    Hi Sam,

    I’ve downloaded the skeleton using Git Bash.
    The skeleton folder I renamed it as ZendTut.

    When I typed php composer.phar self-update in
    /c/xampp/htdocs/Zendtut

    It says sh.exe” : php: command not found.

    Do you have any idea?

    Cheers,

    Jones

    • Sam Reply

      Well yes, reading the blogpost would help ;)
      Fixing this error is explained within, even with a big heading.
      It’s the fourth heading, enjoy!

      • Jones

        Hi Sam,

        I was actually following your guide step by step.

        I’ve resolved the problem. The error occur because I add space after the semicolon when adding php environment.

        Thank you,

        Jones

  37. Sven Reply

    Hey Sam,

    when you install the actual framework in the section “Downloading Zend Framework”, where does it install the framework to? Like where can i find the library with the Zend classes?

    Or in other words, what do these two (php composer.phar self-update php composer.phar install) do exactly?

    Cheers,
    Sven

    • Sam Reply

      Hey Sven, the Framework (and all other 3rd-Party-Libraries defined in Composer) will always and up inside the /vendor folder ;)

      • Sven

        Sweet, thx!

        Got it up and running. Great tut! Thx

  38. Dijo Reply

    Tutorial is excellent. Good work.

  39. Kimberly Reply

    “The program can’t start because libiconv-2.dll is missing from your computer. Try reinstalling the program to fix this problem.” – this error appears whenever I type git in cmd but I’ve already added the msysgit\bin path to my computer environment variables.

    But anyway, git command is working fine using the msys CLI.

    Thanks, though I’m stuck at configuring apache virtual host because my Xampp version is 1.7.2.

    Do you have a workaround to this?

    • Kimberly Reply

      Or, do you know how can I revert the changes I’ve made during the installation, I think I’ll have to change my Zend to lower version (which version do you think will work for XAMPP 1.7.2?) for it to work with my XAMPP ’cause I can’t upgrade it.

      Thanks and regards.

    • Kimberly Reply

      Aw, I’ve installed another version of XAMPP and it’s working now, thanks a lot.

  40. Domin Reply

    Works great!! thanks

  41. Lollpop Reply

    I would love to re post this entry on my own website will that be okay

    • Sam Reply

      As long as a link to the original article is present, you can repost wherever you like ;)

  42. anil Reply

    i have a error when we run the compose install cmd
    [Composer\Downloader\TransportException]

    The “http://packagist.org/p/provider-active$e87d295f1df7c1b952b43b00adb600c25b
    7ceb99afbbd59c667d920d430452ab.json” file could not be downloaded ()

    install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-custom-insta
    llers] [--no-scripts] [--no-progress] [-v|--verbose] [-o|--optimize-autoloader]

    • Sam Reply

      Which “install command”? That error doesn’t really help a lot i’m afraid

  43. Niluk Reply

    Really helpful tutorial from beginning to end

  44. Victorv Reply

    Work this way
    git –version

  45. Eric Reply

    Brilliant job Sam! Once I found your tutorial I had the server and app up and running in 10min!

    Hug!

  46. Johnny Reply

    Hi there,

    Everything has been working as expected up until this point:

    php composer.phar self-update
    php composer.phar install

    When I run the self-update command I get the following output:

    fatal-error: cllas ‘phar’not found in C:\xampp\htdocs\weblog\composer.phar on line 13.

    I have restarted the git cli and attempted again and receive the same result. As can be seen I’m running the command from the weblog directory where the composer.phar file is located.

    Any ides? Please help, much appreciated.

  47. Marcus Reply

    Outstanding tutorial. Got it working. Just wanted to point out a small typo. When you set up virtualhost you say to add the following:

    DocumentRoot “C:/xampp/htdocs/PROJECTNAME/public”
    ServerName http://www.projectname.loc
    ServerAlias projectname.loc

    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all

    I got an error until i figure it out. The line needs to be change to C drive like this:

    Other then that, all was perfect! Thank you very much.

  48. asdf Reply

    Nice tutorial,
    Thank you :)

  49. Pragnesh Karia Reply

    Very useful post

  50. Stefan Schmalhaus Reply

    Thank you very much for this tutorial!

  51. Raghu Reply

    Hey Sam,

    great post man!! Managed to install using your instructions.

    Starting to learn ZF2….are you planning on posting any ZF2 tuts?….would be very helpful

    Thanks again!
    RD

    • Sam Reply

      Hey, im glad u managed to do so! ;) There will certainly be new tutorials, but i do not know about the timeline. Currently i am waiting for a change that is happening within the Doctrine scope and once that change is live, i will work on a real world application and publish this on the blog in here.

  52. mehdi Reply

    Thanks a lot.
    I install zf2 by your perfect guide.if it possible write a new post about how to write first application with zf2.
    becuase i am confused really.
    thanks

  53. bussury Reply

    Thanks man , You make my Day up

  54. David Reply

    Great tutorial! but i when i chaged “http-vhosts.conf” file, saved it and restarted the Apache server i recived the next message:

    “16:30:44 [Apache] Error: Apache shutdown unexpectedly.
    16:30:44 [Apache] This may be due to a blocked port, missing dependencies,
    16:30:44 [Apache] improper privileges, a crash, or a shutdown by another method.
    16:30:44 [Apache] Check the “/xampp/apache/logs/error.log” file
    16:30:44 [Apache] and the Windows Event Viewer for more clues”

    i tried to delete the lines from the file, but i recive the same error, there is something that i could do?

    Thanks a lot!

    • Sam Reply

      Hey there, i do not know too much about apache itself, so sadly i won’t be able to be of too much help in that scope :S Maybe just a typo somewhere? It appears to work for most people using this tutorial step by step :\

  55. Manendra Reply

    this is working properly.

  56. Alexander Taran JR. Reply

    Sam, big thanks for this helpful post! You have most beautiful and sexy girlfriend, congrat! )

  57. Shiv Reply

    Thanks Sam……good work!!!!!!!! Thumbs up!!!!!! :)

  58. Jekin Reply

    Hi Sam,
    Thank you very much.
    should i need to follow above step for making new project in everythime?

  59. Tony Reply

    Very Well Done!
    Maybe you and Snooki should write a book …

  60. David Reply

    It’s very helpful!! really straightforward, thanks Sam!!!

  61. Richard Mugerwa Reply

    Excellent Tutorial. I finally installed this framework. Thanks alooo…t.

  62. Carlos Ramos Reply

    Done!!!!

    It looks like I`m a terrible instruction follower, I uninstalled everything and started over and it works just fine. Thank you for the great tutorial.

    • Sam Reply

      I’m glad it worked for you in the end. It’s usually just a very simple typing-error ;)

  63. Carlos Ramos Reply

    Access forbidden!

    You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

    If you think this is a server error, please contact the webmaster.

    Error 403

    localhost
    Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7

    This is the error message that I get, I did everything to the letter, I really dont know whats wrong!!!

    Thank you great tutorial…..

  64. imtiaz Reply

    great work buddy been looking for this days

    waiting for doctrine installation

    thanks

    • Sam Reply

      Thanks and you’re welcome. The Doctrine Installation is already available. You find the link just below this article ;)

  65. Albert Reply

    Excelente tutorial, funciona perfectamente. Espero que puedas seguir subiendo más acerca de ZF2.

    Gracias :)

  66. tinef Reply

    Great tutorial – worked awesome.
    Just one question: how can I configure my httpd-vhosts.conf to access my skeleton application with weblog.loc and the rest of my folders in C:\xampp\htdocs\ as I did before with localhost/{SUBFOLDER}?

    • Sam Reply

      Hi there, indeed this is a point i should still include into the tutorial, thank you for feedback. It’s pretty simple actually: add another vhost :D

  67. albert Reply

    thank you very much…^^

    • Sam Reply

      You’re welcome

  68. Trikalos Reply

    It was a really helpful tutorial and a life savior since I wanted this urgently to be done.

    Just to add value to your tutorial, I would like to mention that msysGit takes ~10min for complete download and installation. Since I had already installed xampp, the total time it took me to complete your guidelines was roughly 20min.

    Excellent writing, perfect coverage of all possible troubleshoots and more important, it’s written in quite a simple language for the absolute beginner.

    Thank you very much sir, for sharing your knowledge with the rest of us.

    • Sam Reply

      I’m glad this was of help to you!

  69. Alex Reply

    The best tutorial. It really helped me. Thanks

    • Sam Reply

      Glad it helped. Have fun with the framework!

  70. hopper3011 Reply

    Sam;

    Thanks for this – a brilliant tutorial he only problems I had were my own stupidity (mis-spelling some things), and Windows Vista being awkward (it wouldn’t let me change the “hosts” file – I had to restart in Safe Mode before I could do that!).

    Thanks again, never would have got there without you!

    John

    • Sam Reply

      Hey there, I’m glad you found my tutorial helpful. Have fun working with the framework!

  71. Saumya Reply

    Hi,

    I did all steps you mentioned, but each time I accessed
    projectname.loc I redirected to phpinfo() page. can you please help me with that ?

    • Sam Reply

      Hey, sounds to me like your xampp is misconfigured. Where do you end up when you hit http://localhost/ ?

      • Saumya

        Yes.. on any page I tried.
        But when I uninstalled and installed Xampp again. http://localhost works with the home page on xampp.

  72. B.Tomasello Reply

    You’re actually a good webmaster. The site loading pace is incredible. It kind of feels that you’re doing any distinctive trick. Furthermore, The contents are masterpiece. you’ve performed a wonderful process on this matter!

  73. mayank Reply

    Hi,
    I have changed the httpd-vhosts.conf file for apache config to this which works for me. because without updating this my XAMPP is not starting the apache.

    DocumentRoot “C:/xampp/htdocs/ZendSkeletonApplication/public”

    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all

    Thanks for the tutorial. It working fine for me. I am new to Zend. Can you create a new post for ‘ Starting new Project in zend ‘ As i am familiar with MVC but not able to find any MVC structure in this setup.

    • Sam Reply

      Thanks for the hint, i actually had the ErrorLog Statement inside the vhost, my guess is that this directory was non existant for you and therefore apache didn’t start.
      I’m glad you have been able to solve this though.

      What do you mean by starting a new project? Like how to set up new modules and stuff?

      • mayank

        Hi,
        i have one more issue that if i config Apache for Zend then it is not usable for other Projects either they are of PHP or anything else. If possible sort this.

        Yes, i am asking for creating new Zend based project .

        Thanks

      • Sam

        Hey again, what exactly is your error for other projects? You can have multiple VirtualHosts for other Zend-based projects, as well as pure PHP-Projects. Give me an example of what exactly you want to achieve and for sure i will be able to help you out.

  74. john Reply

    does not work

    • Sam Reply

      What exactly doesn’t work for you? I’ll gladly help you out ;)

  75. Franklin Solorzano Reply

    Excelente, Funciona al 100%

    • Sam Reply

      Thank you, i’m glad it works for you!

  76. Jessica Reply

    I am trying to the cmomand zf.bat create project zf_cms and all I get isCreating project at C:/xampp/htdocs/zf_cmsNote: This cmomand created a web project, for more information setting up your VHOST, please see docs/READMEWarning: domdocument::domdocument(): Entity: line 1: parser error : Start tag expected, <' not found in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 82Warning: domdocument::domdocument(): 1.0 in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 82Warning: domdocument::domdocument(): ^ in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 82Fatal error: Call to undefined method domdocument::importNode() in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 85zend_mm_heap corruptedmy php version is 5.2.9 and ZF version is 1.10.I also tried ZF version 1.9 and get the following error:Creating project at C:/xampp/htdocs/zf_cmsWarning: domdocument::domdocument(): Entity: line 1: parser error : Start tag expected, <' not found in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 74Warning: domdocument::domdocument(): 1.0 in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 74Warning: domdocument::domdocument(): ^ in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 74Fatal error: Call to undefined method domdocument::importNode() in C:\xampp\htdocs\ZendFramework\library\Zend\Tool\Project\Profile\FileParser\Xml.php on line 77I am stuck and I alread spent an hour just to figure this out but still no luck. Any help would be very much appreciated.Thanks

    • Sam Reply

      Excuse me but i see no relation to this post at all :S
      zf.bat is something that is of relevance for Zend Framework in version 1 and i don’t have a guide for that :\ You may be better of to direct your question to stackoverflow.com!

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">