How to install Slim Framework on Debian 10?

Windows Articles

How to install Brackets in Windows 10 plus extensions

Hello! Brackets is an open-source code editor designed by Adobe for web developers. Additionally, it has a very simple and modern interface...

How to install Docker on OpenSUSE 15.2 / 15.1?

Docker is a fairly popular technology in today’s sysadmin. It is logical to think because it means a complete change in the...

How to analyze the network with IP Tools for Android

Hi! If you want to analyze and adjust the network almost professionally, then this post is for you. Indeed, IP Tools is...

How to install GNU Fortran on Ubuntu 20.04 / 18.04?

Not everything old is bad. This is how it is. Well, while it is true that there are many programming languages today, there are...

How to install Unity Desktop on Ubuntu 20.04?

Unity Desktop was for a long time the default desktop environment in Ubuntu. Thanks to this, Ubuntu gained a great personality and...
angeloma
angeloma
Senior Writer and partner

Web development in Debian 10 is quite common. This is due to the robustness of the operating system. Therefore, many developers who seek in this system the tranquility of developing their projects without surprises is what makes it a solid alternative. In this sense, PHP is presented to us as the most popular language for the development of web applications. There are many powerful and versatile frameworks to start developing. In this post, I will talk to you about how to install Slim Framework on Debian 10.

Slim a PHP microframework

You have probably heard about the most popular PHP frameworks like Cake or Laravel. Just to quote those two, because there are even better ones. However, in this opportunity, we have a small one that will allow us to develop applications quickly and easily. This is the case of Slim.

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim provides a fast and powerful router that maps route callbacks to specific HTTP request methods and URIs. As an important aspect, Slim supports any PSR-7 HTTP message implementation so you may inspect and manipulate HTTP message method, status, URI, headers, cookies, and body.

All this in a framework quite light and quick to use. So, let us install it on Debian 10.

Install Slim framework on Debian 10

Obviously the first step is to have PHP installed. To do this, just use this specific command to install it and also several of its modules:

:~$ sudo apt install php php-mbstring php-xml php-zip php-cli php-intl
1.- Install PHP on Debian 10
1.- Install PHP on Debian 10

The most recommended way to install Slim Framework is using Composer. As you know composer is a PHP dependency manager that is quite light and fulfills its purpose.

To install it in any Linux distribution we have a post.

Read, How to install Composer on Linux?

Then, we can start the installation.

To start the development with Slim quickly, it is recommended to use the slim-skeleton base that provides all the initial configurations made to save time. So to create the project use the following command:

:~$ composer create-project slim/slim-skeleton [app-name]

Of course, replace [app-name] with the name of your project. Then, it will start all dependency downloads.

2.- Install Slim framework on Debian 10
2.- Install Slim framework on Debian 10

When you’re done you’re ready to start. Of course, if you guide to see the application running, enter the project folder:

:~$ cd [app-name]
:~$ php -S localhost:8080 -t public public/index.php

Remember that you can change localhost for the host IP address and 8080 for another chosen port. If you are going to use this port, remember that it must be available in the firewall.

Then, go to your web browser and you’ll see something like this:

3.- Slim framework working on Debian 10
3.- Slim framework working on Debian 10

And ready, let’s keep working.

Conclusion

Slim is a lightweight framework for making web applications and APIs with PHP. Everything is fast and easy. Therefore, it is a very important alternative for our professional environment. Especially if we work with programming.

Please share this post and join our Telegram channel.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Brackets in Windows 10 plus extensions

Hello! Brackets is an open-source code editor designed by Adobe for web developers. Additionally, it has a very simple and modern interface...

How to install Docker on OpenSUSE 15.2 / 15.1?

Docker is a fairly popular technology in today’s sysadmin. It is logical to think because it means a complete change in the...

How to analyze the network with IP Tools for Android

Hi! If you want to analyze and adjust the network almost professionally, then this post is for you. Indeed, IP Tools is...

How to install GNU Fortran on Ubuntu 20.04 / 18.04?

Not everything old is bad. This is how it is. Well, while it is true that there are many programming languages today, there are...

How to install Unity Desktop on Ubuntu 20.04?

Unity Desktop was for a long time the default desktop environment in Ubuntu. Thanks to this, Ubuntu gained a great personality and...