How to Install Laravel on Rocky Linux 8

Install Laravel on Rocky Linux 8

In this article, we will have explained the necessary steps to install Laravel on Rocky Linux 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Laravel is one of the most popular PHP frameworks in the world, and it’s great for developers looking to build modern web applications. Its philosophy is to develop PHP code elegantly and simply based on an MVC (Model-View-Controller) model.

Install Laravel on Rocky Linux 8

Step 1. First, before you start installing any package on your Rocky Linux server, we always recommend making sure that all system packages are updated.

sudo dnf install epel-release
sudo dnf update
sudo dnf upgrade

Step 2. Install PHP.

Installing PHP and a few other extensions with the below command:

sudo dnf install php php-common php-cli php-gd php-mysqlnd php-curl php-intl php-mbstring php-bcmath php-xml php-zip

Verify the PHP version:

php -v

Step 3. Install PHP  Composer.

To install composer, run the following command:

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

After that, move the downloaded binary to the system path and set proper permission:

mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer

Verify the composer version:

composer --version

Step 4. Install Laravel on Rocky Linux.

First, create a Laravel project using the following command below:

composer create-project laravel/laravel my_project_app

After that, go to the project directory and start Laravel’s local development server:

cd my_project_app
php artisan serve

You should get the following output:

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

Step 5. Accessing Laravel Interface.

Finally, open your web browser and go to http://127.0.0.1:8000 and you will now get the below web page:

Install Laravel on Rocky Linux 8

That’s all you need to do to install Laravel on Rocky Linux 8. I hope you find this quick tip helpful. For further reading on Laravel PHP frameworks, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.