How to Install Laravel on Debian 11 / Debian 10 – Holhol24

3

Laravel is an open-source internet utility framework with expressive, chic syntax. It is likely one of the most well liked PHP frameworks on the earth, and it’s nice for builders taking a look to construct fashionable internet packages.

But putting in a building surroundings can also be irritating to novices. Thankfully, as soon as you already know the fundamentals of the set up procedure, you’ll the Laravel task up and working very quickly!.

Here, you’ll learn to set up Laravel on Debian 11 / Debian 10.

Install PHP

Laravel calls for PHP edition 7.3 or more recent. Since Debian 11 and Debian 10 comes with PHP 7.4 and PHP 7.3, respectively, you don’t want to get PHP programs from exterior repositories.

Update the repository knowledge.

sudo apt replace

Install PHP and few different extensions with the beneath command.

sudo apt set up -y php-common php-cli php-gd php-mysql php-curl php-intl php-mbstring php-bcmath php-imap php-xml php-zip

Check the PHP edition submit the set up of programs.

php -v

Ensure the PHP edition is 7.3 or later.

PHP 7.4.21 (cli) (constructed: Jul  2 2021 03:59:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.21, Copyright (c), via Zend Technologies

Install PHP Composer

Composer is a dependency supervisor for PHP. It will permit you to obtain and set up Laravel with the essential parts on your task building.

You can set up composer in the community, in your task listing, or globally on $PATH directories (ex /bin or /usr/bin).

wget -qO - https://getcomposer.org/installer | sudo php -- --install-dir=/usr/native/bin/ --filename=composer

Verify the composer edition.

composer --version

Output:

Composer edition 2.1.6 2021-08-19 17:11:08

Install Laravel

Since you have already got PHP Composer in your gadget, you’ll simply create a Laravel task the use of the beneath command.

composer create-project laravel/laravel my_example_app

Once the task is created, move to the task listing.

cd my_example_app

And then, get started Laravel’s native building server the use of the Artisan CLI’s serve command.

php artisan serve

You gets the message one thing like this.

Starting Laravel building server: http://127.0.0.1:8000

By default, Laravel listens at the localhost with port 8000. In case if you need, you’ll use the --host and --port method to exchange the listening cope with and port of Laravel, respectively.

You can open up your browser and get entry to the Laravel building server with the IP cope with and the port quantity displayed within the earlier command output. You gets the beneath internet web page.

Laravel Development Server

Conclusion

That’s All. I am hoping you easy methods to set up Laravel on Debian 11 / Debian 10. As a subsequent step, you’ll carry out preliminary configurations and observe the documentation to be told Laravel.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More