Install Laravel 10 on your system

107
0

Laravel is a popular PHP framework for web application development that provides a clean and elegant syntax, powerful tools and features to make web development easier and faster. Here are the step-by-step instructions to install Laravel 10 on your system:

Prerequisites:

  • PHP 8 or higher
  • Composer
  • MySQL or MariaDB
  • Git (optional)

Step 1: Install PHP 8 If you don’t have PHP 8 installed on your system, you can download it from the official website. Follow the installation instructions for your operating system.

Step 2: Install Composer Composer is a dependency manager for PHP. You can download the installer from the official website and follow the installation instructions.

Step 3: Install MySQL or MariaDB You need a database management system to store your application data. You can download and install MySQL or MariaDB from their respective official websites.

Step 4: Install Git (optional) If you want to manage your codebase with Git, you can install it from the official website.

Step 5: Install Laravel Installer The Laravel Installer is a command-line utility that simplifies the process of creating a new Laravel application. You can install it globally using Composer by running the following command in your terminal:

composer global require laravel/installer

Step 6: Create a new Laravel Project Once you have installed the Laravel installer, you can create a new Laravel project by running the following command in your terminal:

laravel new my-project

Replace “my-project” with the name of your project. This command will create a new Laravel project in a directory with the same name.

Step 7: Configure the Database Before you can use your Laravel application, you need to configure the database settings. Open the .env file in your project root directory and update the following settings according to your database setup:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_database
DB_USERNAME=my_username
DB_PASSWORD=my_password

Replace “my_database”, “my_username” and “my_password” with your actual database name, username and password.

Step 8: Run the Application You can run your Laravel application by using the following command in your terminal:

php artisan serve

This command will start a development server at http://localhost:8000. You can open this URL in your web browser to view your Laravel application.

Congratulations, you have successfully installed Laravel 10 on your system and created a new Laravel project!

Leave a Reply

Your email address will not be published. Required fields are marked *