Laravel is one of the most popular PHP frameworks in the world, and it’s great for developers looking to build modern web applications. Sometimes, setting up a development environment can be frustrating to newcomers. Thankfully, once you understand the basics of the installation process of Laravel, your project will be up and running in no time!.
Here, you will learn how to install Laravel on Fedora 35 / Fedora 34.
Install PHP on Fedora 35
Laravel requires PHP version 7.3 or newer. Since Fedora 35 and Fedora 34 come with PHP 8.0 and PHP 7.4, you do not need to get PHP packages from external repositories.
Install PHP and a few other extensions with the below command.
sudo dnf install -y php php-common php-cli php-gd php-mysqlnd php-curl php-intl php-mbstring php-bcmath php-xml php-zip
Then, check the PHP version post the installation of packages.
PHP 8.0.13 (cli) (built: Nov 16 2021 18:07:21) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.13, Copyright (c) Zend Technologies
Install PHP Composer on Fedora 35
Composer is a dependency manager for PHP, and it will help you download and install Laravel with the necessary components for your project development.
sudo dnf install -y composer
Verify the composer version.
Composer 2.1.12 2021-11-09 16:02:04
Install Laravel on Fedora 35
After installing PHP composer on your system, you can easily create a Laravel project using it.
composer create-project laravel/laravel my_example_app
Once the project is created, go to the project directory.
And then, start Laravel’s local development server using the Artisan CLI’s serve command.
php artisan serve
You will get the message something like this.
Starting Laravel development server: http://127.0.0.1:8000
By default, Laravel listens on the localhost with port 8000. In case if you want, you can use the –host and –port option to change the listening address and port of Laravel, respectively.
Now, you can open up your browser and access the Laravel development server with the IP address and the port number displayed in the previous command output.
You will now get the below web page.