How to install Slim Framework in Windows 10.

Windows Articles

OpenSUSE 15.2 available

Well, another one has come into the family. A new version of OpenSUSE has recently been released. The community distribution under the...

How to install and configure Vagrant in Windows 10

Hello! Vagrant is a free, multi-platform command-line tool, which makes it easy to create reproducible and shareable development environments. Additionally, it creates...

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

How to recover files deleted with Windows File Recovery

Hello! Deleting files by accident is one of the biggest fears of users. Indeed, unintentionally deleting documents, music or photos can be...

How to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10?

This is a short post in which I will show you how to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10...

Hi, how are you? Today we’re going to talk a little bit about Slim Framework. This is a micro-framework for PHP that helps us develop web applications and APIs faster. At its core, Slim is a dispatcher that receives an HTTP request. It then invokes a callback routine and returns an HTTP response. Additionally, it is recommended when an application needs to be prototyped in a short time. In other words, it works very well when we only need php to launch the rest operations against the database requested by a client application. An additional advantage is that its learning curve is very fast. Consequently, it can be learned in a few sessions. Well, in this post we will see how to install Slim Framework in Windows 10.

Prerequisites.

In order to install Slim Framework on Windows 10, a number of dependencies must be satisfied. Fortunately, in osradar.com we explain in detail how to install each one.

  • PHP installed in version 7.1 or higher. See this post for how to install it.
  • Apache server installed. You can also use Nginx or any other web server.
  • Finally, it is necessary to have installed PHP composer. Please check this post to see how to install it.

Preparing the installation of Slim Framework on Windows 10.

In the first place, head for the following address: C:Apache24. Then create a folder and assign it the name of your preference. Please note that the framework will be installed in this folder.

Create a new folder.
Create a new folder.

Downloading and installing Slim Framwork using Composer.

Once the folder is created, open a Command Prompt inside it. Forthwith, add the following command:

 composer require slim/slim:"^3.0" 
Composer installing Slim Framework.
Composer installing Slim Framework.

Just wait a few minutes while the framework is installed.

Testing Slim Framework.

After we have installed Slim, we will test its operation by launching a Hello World. With that intention, it is necessary to create an index.php file inside the program folder. With that in mind, use the text editor of your choice. In this case, I will use Notepad++. Please add the following text to the file:

<?php
 
require "vendor/autoload.php";

$app = new Slim\App();

$app->get("/",function(){

echo "Hello World";
});

$app->run();

?>
Creating the index.php file in Notepad++.
Creating the index.php file in Notepad++.

After adding the above text, then save the file and name it index.php

Save the index.php file
Save the index.php file

Finally, open the web browser and open localhost accompanied by the Slim installation folder. In this case: localhost/slim_osradar/

Slim Framework
Slim Framework

Ultimately we have seen how to install Slim Framework on Windows 10. This is a great option to get started in the world of PHP programming. This is all for now before I say goodbye I invite you to see our post about upgrading to Windows 10 for free.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

OpenSUSE 15.2 available

Well, another one has come into the family. A new version of OpenSUSE has recently been released. The community distribution under the...

How to install and configure Vagrant in Windows 10

Hello! Vagrant is a free, multi-platform command-line tool, which makes it easy to create reproducible and shareable development environments. Additionally, it creates...

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

How to recover files deleted with Windows File Recovery

Hello! Deleting files by accident is one of the biggest fears of users. Indeed, unintentionally deleting documents, music or photos can be...

How to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10?

This is a short post in which I will show you how to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10...