To install Laravel 8, follow these steps:
1. Install PHP & Required Extensions
Ensure your system meets Laravel 8's requirements:
- PHP ≥ 7.3
- Required extensions:
- OpenSSL
- PDO
- Mbstring
- Tokenizer
- XML
- Ctype
- JSON
- BCMath
- Fileinfo
Check your PHP version:
php -v
2. Install Composer
Laravel requires Composer, a PHP dependency manager.
Download and install Composer from getcomposer.org.
Verify installation:
composer -V
3. Install Laravel 8 Using Composer
Run the following command to create a new Laravel 8 project:
composer create-project --prefer-dist laravel/laravel project_name "8.*"
Replace project_name
with your desired project folder name.
Alternatively, you can use the Laravel installer:
composer global require laravel/installer
laravel new project_name --version="8.*"
4. Configure Environment
Navigate to the project directory:
cd project_name
Copy .env.example
to .env
:
cp .env.example .env
Generate the application key:
php artisan key:generate
5. Configure Database
Edit .env
and set up your database connection:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
Run migrations (if needed):
php artisan migrate
6. Start Laravel Development Server
Run:
php artisan serve
Your Laravel application will be available at:
http://127.0.0.1:8000
That's it! 🎉 Laravel 8 is now installed and running. Let me know if you need help! 🚀😊
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Copyright 2023-2025 © All rights reserved.