Mahamudul Hasan Rubel
HomeAboutProjectsSkillsExperienceBlogCoursesPhotosContact
Mahamudul Hasan Rubel

Senior Software Engineer crafting high-performance web applications and SaaS platforms.

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Courses
  • Photos
  • Contact

Get in Touch

Available for senior/lead roles and consulting.

bd.mhrubel@gmail.comHire Me

© 2026 Mahamudul Hasan Rubel. All rights reserved.

Built with using Next.js 16 & Tailwind v4

Back to Blog
Lesson 1 of the Laravel Fundamentals: From Zero to Your First App course
LaravelJune 24, 20264 min read

Setting Up the Local Development Environment for Laravel

Master your Laravel environment setup by installing PHP, Composer, and SQLite. Get your terminal configured to start building our Task Manager application.

LaravelPHPComposerSQLiteDevelopment Environmentbackend

Welcome to the "Laravel Fundamentals: From Zero to Your First App" course. This is where we lay the foundation for everything we’ll build. Before we can write a single line of application code, we need to ensure your machine is a capable "Laravel factory."

In this lesson, we will install PHP, Composer, and SQLite, and configure your terminal environment. These tools are the bedrock of modern PHP development, and getting them right now prevents hours of frustration later.

Understanding the PHP Ecosystem

Laravel is built on top of PHP, a server-side scripting language designed for web development. Unlike languages that require complex compilation, PHP is interpreted, making it incredibly fast for iterative development.

To manage the libraries and packages that make Laravel powerful, we use Composer. Think of Composer as the "App Store" for PHP code. It downloads the framework, handles dependencies, and ensures your project has exactly what it needs to run. Finally, for our database, we will use SQLite. As discussed in SQLite for Local-First Web Applications: A Practical Guide, it is a file-based database engine that requires no server configuration, making it the perfect choice for our local Task Manager project.

Installing the Essentials

A minimalist light bulb with exposed wires hanging from a white ceiling, ideal for home renovation themes.

1. Installing PHP

You need PHP 8.2 or higher to run current Laravel versions.

  • macOS: Use Homebrew by running brew install php.
  • Windows: Download the "Thread Safe" zip file from windows.php.net and add the folder path to your System Environment Variables.
  • Linux (Ubuntu/Debian): Use sudo apt install php php-cli php-mbstring php-xml php-curl.

Verify your installation by running:

Bash
php -v

You should see output confirming your version is at least 8.2.0.

2. Installing Composer

Composer is the standard dependency manager for PHP. Download the installer from getcomposer.org.

Once installed, you should be able to run composer from anywhere in your terminal. Verify it with:

Bash
composer --version

3. Verifying SQLite

Most modern PHP installations come with the SQLite extension enabled by default. To check if it's available, run:

Bash
php -m | grep sqlite

If you see pdo_sqlite in the list, you are ready to go. If not, ensure the extension is uncommented in your php.ini file.

Configuring Your Terminal Environment

To work efficiently, your terminal needs to "find" these programs. If you type php and get a "command not found" error, your system's PATH variable is misconfigured.

  • macOS/Linux: Edit your ~/.zshrc or ~/.bashrc file and ensure the directory containing your binaries is in your PATH export.
  • Windows: Ensure the directory where you extracted PHP is in your System Path variable.

Hands-on Exercise

Let's confirm your setup is "Laravel-ready." Open your terminal and run the following command to check if you can reach the PHP binary:

Bash
# This should print the current PHP version again
php -r "echo PHP_VERSION;" 

Next, try to create a dummy directory and run a Composer command:

Bash
mkdir test-env && cd test-env
composer init --no-interaction

If this creates a composer.json file without errors, your terminal environment is correctly configured.

Common Pitfalls

  1. Multiple PHP Versions: If you have multiple versions of PHP installed (e.g., one from Homebrew and one system default), your terminal might be looking at the wrong one. Always check which php to see the path of the binary being executed.
  2. Missing Extensions: Laravel requires specific PHP extensions (like bcmath, ctype, fileinfo, mbstring, pdo, and xml). If you run into "missing extension" errors later, don't panic—it just means you need to install that specific module via your package manager.
  3. PATH Confusion: If you install Composer but your terminal says "command not found," restart your terminal application. It needs to reload the shell configuration to recognize the new path.

Recap

We’ve successfully installed the core toolkit for our Laravel development:

  • PHP: The engine that runs our code.
  • Composer: The tool that manages our framework and libraries.
  • SQLite: Our lightweight, file-based database for the Task Manager.
  • Terminal: Properly configured to execute these tools globally.

With these pieces in place, your local environment is now prepared for the next step: bringing in the framework itself.

Up next: Installing Laravel and Exploring Directory Structure.

Next lesson Installing Laravel and Exploring Directory Structure
Back to Blog

Similar Posts

LaravelJune 24, 20263 min read

Installing Laravel and Exploring Directory Structure

Learn how to use the Laravel installer to scaffold a new project and master the framework's directory structure to navigate your application with confidence.

Read more
LaravelPHPJune 23, 20264 min read

Laravel task scheduling: A beginner’s guide to automation

Part of the course

Laravel Fundamentals: From Zero to Your First App

beginner · Lesson 1 of 52

  1. 1

    Setting Up the Local Development Environment

    4 min
  2. 2

    Installing Laravel and Exploring Directory Structure

    3 min
  3. 3

    Understanding the .env File and Configuration

    3 min

Master Laravel task scheduling to automate recurring jobs with ease. Stop managing complex crontabs and learn the clean, native way to handle background tasks.

Read more
LaravelJune 24, 20263 min read

Understanding the .env File and Configuration in Laravel

Learn how to manage environment variables in Laravel using the .env file. Master configuration best practices to keep your application secure and portable.

Read more
  • 4

    The Laravel Application Lifecycle

    Coming soon
  • 5

    Initializing the Task Manager Project

    Coming soon
  • 6

    Defining Basic Web Routes

    Coming soon
  • 7

    Using Route Parameters

    Coming soon
  • 8

    Creating Your First Controller

    Coming soon
  • 9

    Returning Responses and Redirects

    Coming soon
  • 10

    Task Manager: Implementing the Task List Route

    Coming soon
  • 11

    Introduction to Blade Templating

    Coming soon
  • 12

    Using Blade Layouts and Sections

    Coming soon
  • 13

    Implementing Blade Partials

    Coming soon
  • 14

    Mastering Blade Directives for Loops and Conditionals

    Coming soon
  • 15

    Task Manager: Building the User Interface

    Coming soon
  • 16

    Understanding Database Migrations

    Coming soon
  • 17

    Working with Eloquent Models

    Coming soon
  • 18

    Performing Basic CRUD Operations

    Coming soon
  • 19

    Seeding the Database

    Coming soon
  • 20

    Task Manager: Displaying Real Database Records

    Coming soon
  • 21

    Capturing User Input from Forms

    Coming soon
  • 22

    Introduction to Laravel Validation

    Coming soon
  • 23

    Customizing Validation Error Messages

    Coming soon
  • 24

    Using Form Requests for Validation

    Coming soon
  • 25

    Introduction to Authentication

    Coming soon
  • 26

    Protecting Routes with Middleware

    Coming soon
  • 27

    Understanding CSRF Protection

    Coming soon
  • 28

    Preventing Mass Assignment

    Coming soon
  • 29

    Task Manager: Securing the Application

    Coming soon
  • 30

    Introduction to Route Model Binding

    Coming soon
  • 31

    Updating Existing Records

    Coming soon
  • 32

    Deleting Records

    Coming soon
  • 33

    Using Named Routes

    Coming soon
  • 34

    Task Manager: Completing CRUD Functionality

    Coming soon
  • 35

    Introduction to Database Relationships

    Coming soon
  • 36

    Querying Related Data

    Coming soon
  • 37

    Handling File Uploads

    Coming soon
  • 38

    Using Flash Messages for User Feedback

    Coming soon
  • 39

    Task Manager: Adding Status and Priorities

    Coming soon
  • 40

    Introduction to Artisan Commands

    Coming soon
  • 41

    Debugging with Laravel Tinker

    Coming soon
  • 42

    Understanding Service Providers

    Coming soon
  • 43

    Using View Composers

    Coming soon
  • 44

    Task Manager: Refactoring for Clean Code

    Coming soon
  • 45

    Introduction to Testing

    Coming soon
  • 46

    Testing Forms and Validation

    Coming soon
  • 47

    Using Database Transactions

    Coming soon
  • 48

    Handling Global Exceptions

    Coming soon
  • 49

    Preparing for Production

    Coming soon
  • 50

    Environment Security Best Practices

    Coming soon
  • 51

    Managing Assets in Production

    Coming soon
  • 52

    Task Manager: Deployment Preparation

    Coming soon
  • View full course