1 C
Texas
angeloma
Senior Writer and partner

How to install Laravel on Fedora 34?

Normally to ensure the quality of web applications are developed using a Framework. Laravel is one of the best frameworks for it. So, In this article, I will show you how to install Laravel in Fedora 34.

Laravel is a PHP framework that offers the possibility of developing applications quickly, agile and with a readable source code. So, many developers use it to make their most popular applications.

In short, this is a nice framework to develop web applications very quickly with a beautiful source code.

So, let’s install Laravel on Fedora 34.

1 Install PHP

- Advertisement -

Since it is a PHP framework it is obvious that you must install PHP. So let’s go for it.

:~$ sudo dnf install php php-common php-cli php-pdo php-mbstring php-zip php-xml php-cli php-json

1.- Install PHP on Fedora 34
1.- Install PHP on Fedora 34

2. Install Composer

Composer is a dependencies manager for PHP. So, it is very useful to manage libraries required by our projects and is used to install Laravel.

:~$ curl -sS https://getcomposer.org/installer | php

Then, make sure that Composer can be used globally in the terminal.

:~$ sudo mv composer.phar /usr/local/bin/composer
:~$ sudo chmod +x /usr/local/bin/composer
:~$ composer -V

2.- Composer on Fedora 34
2.- Composer on Fedora 34

Now, you can install Laravel.

5. Install Laravel

It’s time to install Laravel. So, run this command.

:~$ composer global require "laravel/installer"

Once the installation is finished. You can create a new project. But, first, make Laravel executable available for the system.

:~$ echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc

Then, close the terminal and open it again. Now, create a project.

:~$ laravel new example

3.- Laravel project
3.- Laravel project

Then, start the Laravel instance.

:~$ php artisan serve

4.- Laravel serve
4.- Laravel serve

As you can see, the IP address you need to go is 127.0.0.1:8000. Also you can specify a diferent host and port. For example:

:~$ php artisan serve  --host=0.0.0.0 --port=1234

Open your web browser and go to the IP address.

Laravel working on Fedora 34
Laravel working on Fedora 34

Laravel is correctly installed.

If you want to use MariaDB in a project with Laravel, then you need to edit the .env file located in the project. In it, you must specify database, port, user, and password of the user MariaDB.

Conclusion

As you’ve seen, installing Laravel on Fedora 34 is simple, you just have to have a basic knowledge about LAMP and that’s it.

So, Please share this article with your friends.

You can also read “How to install Yii PHP Framework on Debian 10?

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article