How to setup Symfony 2 in XAMPP | Beginners guide

Hi all,

Today, I will be showing you how to setup Symfony 2 in XAMPP environment. This is a real beginners guide, so this post is for beginners, and will be useful to fellas who are new to PHP frameworks, setting up frameworks in XAMPP.

  1. First thing you need to do is download the latest version of Symfony 2 from the Symfony 2 website. (The most latest version for this moment is 2.7) And also you need to download the most recent version of XAMPP from their website. (The most recent version is 2.4.17). Then install the XAMPP using default settings.
  2. I hope you have a working version of XAMPP and downloaded Symfony 2 zip file. Create a folder called ‘Symfony‘ inside this path ‘C:\xampp\htdocs‘.  (If you haven’t installed under C:\ or installed in different directory, make sure you use that path). Now what you have to do is, extract Symfony 2 zip file in ‘C:\xampp\htdocs\symfony‘ location.
  3. So, your extracted directory looks like this,
  4. symfony2 folder structureAt the moment, you don’t have to worry about these files and folders. (I am having an thought to start writing a Symfony 2 tutorial soon) But you can always get more information about the folder structure and files from here.
  5. So this is pretty much it what you have to do for setting up the Symfony  2 in your XAMP. If you go to this link – localhost\symfony\web\app_dev.php, you will see Symfony 2’s welcome screen, which is similar to this,symfony2-welcome-screen
  6. But, for some users they won’t see this welcome screen due to a security prevention. To solve this problem, go to ‘web\app_dev.php’ and edit the file. And comment lines from 12 to 18 (the if condition). See below,Comment in app_dev.php in Symfony 2
  7. After commenting above line, it should work now 🙂

As I said this a real beginners guide on how to setup Symfony 2 in XAMPP. I am sure you enjoyed this post. Stay tuned for more tutorials in the future. Feel free to explore the power of Symfony 2, if  you have any questions, feel free to add it under the comments section below, see you !




10 thoughts on “How to setup Symfony 2 in XAMPP | Beginners guide

  1. I see you share interesting stuff here, you can earn some extra money, your blog has
    huge potential, for the monetizing method, just search in google – K2 advices how to monetize a website

  2. Hi, I’ve done this setup, but now I wanted to create a new project with phpstorm, but i can’t seem to get it to work, and i am a beginner in php so i don’t know how to fix it, always saying bad gateway and stuff in chrome…

  3. sirisha says:

    I tried installing symfony 2.6. When I hit http://localhost/symfony/web/app_dev.php.I have commented lines from 12 to 18 even after that I am getting error
    Fatal error: require_once(): Failed opening required ‘C:\xampp\htdocs\symfony\web/../app/bootstrap.php.cache’ (include_path=’C:\xampp\php\PEAR’) in C:\xampp\htdocs\symfony\web\app_dev.php on line 20.
    Please help me in this.

Leave a Reply

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