ホーム > Laravel > How to Install Laravel 8
Laravel

How to Install Laravel 8

Thank you for your continued support.
This article contains advertisements that help fund our operations.

⇨ Laravel Article Table of Contents Here

This guide shows how to install Laravel 8 simply without using Docker or Sail. It is recommended for those who are using a server-side framework for the first time and those who are not familiar with Docker.

Conclusion

If you already have PHP and Composer installed, you can set up a Laravel project with just one command.

composer create-project --prefer-dist laravel/laravel example-app "8.\*"

This will complete the installation. Replace example-app with your desired project name, and a folder with that name will be created.

Compatible PHP Version

Laravel 8 requires PHP 7.3 or higher.

Considering the versions currently supported with security updates, you can choose from:

PHP 8.1
PHP 8.2
PHP 8.3

Check Current PHP Version

php -v

Please check your current PHP version.

How to Install PHP 8.1 on Mac

Install the required components using the command line.

First, check if Homebrew is installed.

brew -v

If Homebrew is not installed, use the following command to install it:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then, install PHP 8.1:

brew install php@8.1

Set PHP 8.1 as the default version:

brew link --overwrite --force php@8.1

Verify that the installation was successful:

php -v

How to Install PHP 8.1 on Windows

Download PHP 8.1 from the official PHP website.

Unless there is a specific reason, download the Thread Safe version (zip file).

Official PHP Download Page

Unzip the downloaded PHP file and save it in a desired location, such as C:\php.

To use PHP from the command line, add the PHP path to the system environment variables:

  1. Control Panel > System and Security > System > Advanced System Settings
  2. Click on Environment Variables, select Path under System Variables, and click Edit.
  3. Add the folder where PHP is saved (e.g., C:\php) to the Path.

Check using the command:

php -v

Install Composer

【Laravel Environment Setup】How to Install Composer

You might not have Composer, a PHP package manager, installed.

Following the article will help you install Composer, so be sure to check it out.

How to Install Laravel 8

Once you have the compatible PHP and Composer installed and working, simply run the command mentioned in the conclusion to install Laravel 8.

composer create-project --prefer-dist laravel/laravel example-app "8.\*"

Summary

That’s all. I hope this helps someone.

Please Provide Feedback
We would appreciate your feedback on this article. Feel free to leave a comment on any relevant YouTube video or reach out through the contact form. Thank you!