How to Install Laravel on Fedora 36 / Fedora 35

0

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 36 / Fedora 35.

Install PHP on Fedora 36

Laravel requires PHP version 8.0 or newer. Since Fedora 36 and Fedora 35 come with PHP 8.1 and PHP 8.0, you do not need to get PHP packages from external repositories.

First, 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 -v

Output:

PHP 8.1.6 (cli) (built: May 11 2022 01:14:18) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies

Install PHP Composer on Fedora 36

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 --version

Output:

Composer version 2.3.5 2022-04-13 16:43:0

Install Laravel on Fedora 36

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.

cd my_example_app

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 you want, you can use the --host <ip_address> and --port <port_number> 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.

Laravel on Fedora 36
Laravel on Fedora 36

Conclusion

That’s All. I hope you have learned how to install Laravel on Fedora 36 / Fedora 35. Next, you can perform initial configurations and follow the documentation to learn Laravel.

You might also like