Laravel is a popular PHP framework for building modern web applications. Installing Laravel is straightforward, especially if you have the required tools ready. In this guide, we’ll go through the process step-by-step.
Before installing Laravel, make sure your server or local machine meets these requirements:
PHP: Version 8.1 or higher
Composer: Installed
Database: MySQL, PostgreSQL, SQLite, or SQL Server
Extensions: OpenSSL, PDO, Mbstring, Tokenizer, XML, Ctype, JSON, BCMath, Fileinfo
Laravel uses Composer to manage dependencies.
If you don’t have Composer installed, download it from:
https://getcomposer.org/download/
composer -v
composer create-project laravel/laravel myapp
Here, myapp
is the name of your project folder.
cd myapp
php artisan serve
Your application will be available at:
http://127.0.0.1:8000
APP_NAME="My Laravel App"
APP_ENV=local
APP_KEY=base64:randomKeyHere
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000 DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=my_database DB_USERNAME=root DB_PASSWORD=
You have successfully installed Laravel! You can now start building your application by creating routes, controllers, and views.