How to install Slim Framework 3 in windows using XAMPP

Slim is a powerful php micro framework which allows developers to create web applications. In this tutorial I am going to describe you about how to install Slim Framework 3.

I will use Composer for installing Slim Framework. So I am assuming that you already install Composer on your Windows machine. If you don’t know how to install composer then check my post how to install composer on windows with XAMPP

First of all create a directory in your xampp/htdocs folder. In my example I am taking testSlim folder. Once testSlim folder is created then create composer.json (file name should be same ) file inside testSlim folder. Now open composer.json and paste following  json code.

In the above json code “require” key is telling composer about your project dependencies.  slim/slim-skeleton is a package name which consist of two parts first part is vendor name and second part is project name. 3.* is a package version which means any version in the 3 development branch or  in other words version > 3.0 but < 3.9.

Now open your command prompt using xampp/htdocs/testSlim folder and type composer install.

Once you hit composer install, you will see the download process with package information and dependencies just like below.

Congratulation you have successfully installed Slim Framework on your XAMPP but job is not done right now.

Now goto testSlim folder under htdocs  and create index.php file and open it and paste below code in index.php and save it.

Now goto browser and hit testSlim url like http://localhost:8080/testSlim you will see hello World. That’s it.

I have started step by step tutorial on making website using slim 3 framework if you wish to learn click on below link.

Also Read:


7 Replies to “How to install Slim Framework 3 in windows using XAMPP”

  1. Hello Ahsan ! 🙂 Careful, you wrote “composor.json” instead of compos{e}r in your third paragraph ^_^ Thanks !

  2. I tried to install Slim through documentation but it did’nt work. Now i did it thanks to you.
    Thank you

  3. Your instructions, or at least a link to them, should be put into the slim documentation.
    They should title it: Instructions for windows xampp apache users.

  4. I get the following message:
    Page Not Found
    The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.

    Visit the Home Page

    When I put the files in the root folder (htdocs) it works, in another folder it gives!

Leave a Reply

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