How To Install Laravel on Debian 11

x


Debian 11 is a full-featured operating system that appeals to many web developers. In this sense, it is possible to use it to create applications in almost any language and PHP is no exception. In this post, you will learn how to install Laravel on Debian 11. This is one of the most popular frameworks that exist worldwide and is a good gateway to web development.

Before we start with the installation process of Laravel, it’s worth giving a little introduction about what this framework is.

Laravel The PHP Framework For Web Artisans

According to the Laravel website

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation – freeing you to create without sweating the small things.

This is one of the most widely used PHP frameworks in the world. It has one of the most active communities you can find anywhere in the world.

As you might expect, Laravel is an open-source framework that is constantly evolving thanks to its active development and the powerful community behind it.

With Laravel, we will have the possibility to use an advanced template manager thanks to Blade. Also, the abstraction layer provided by Eloquent makes it easy to work with data and database handlers.

Laravel is a powerful framework with which we can make many different web applications quickly and with the help of many people. Finally, Laravel is incredibly scalable; so, many Laravel applications have been easily scaled to handle hundreds of millions of requests per month.

So let’s go for it.

Install Laravel on Debian 11

Laravel is a tool that is built with PHP and can be managed with PHP Composer.

So, the first step is to install PHP Composer.

Install Composer on Debian 11

Composer is a PHP dependency manager with which we can quickly install, remove and update libraries that are required by our application.

Thanks to Composer, we will be able to install Laravel on the system. So, to install Composer on Debian 11 we recommend our post about it where you will find detailed instructions about the process.

Install Laravel on Debian 11

After Composer is ready for action, we then need to install some extra PHP modules so that Laravel can be installed without any problems.

sudo apt install php php-bcmath php-json php-mbstring php-pdo php-tokenizer php-xml php-xml php-pear php-zip php-zip php-zip unzip

After that, with the help of Composer, you can install and create a new Composer project as follows

composer create-project – prefer-dist laravel/laravel your-project

Replace your-project with the name of your project and it will start installing and downloading dependencies.

At the end, you will get a message similar to this

Application Key set successfully

This will create a new folder with the name of your project.

Access this folder and there will be the whole structure of your new project.

cd your-project

And to verify that all the installation has been successful, you can run

php artisan serve

This will make your project available from http://localhost:8000.

Also, you can specify a different host and port like this

php artisan serve – host=0.0.0.0.0.0 – port=1234

Replace the host and port values with whatever you want.

Laravel on Debian 11
Laravel on Debian 11

Conclusion

Thanks to Laravel we can have a whole machine to develop PHP web applications with the security of knowing that our application will be well done and with high-quality standards. In this post, you learned how to perform a basic installation of Laravel ideal for those who are learning this world can follow.

So, share this post and leave us a comment.