MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Setting a Local Development Environment for Laravel on Windows | Install Laravel on Windows

Many developers use Windows for PHP projects, we will cover a basic XAMPP Setup for a Laravel project. Following these easy steps will help you run your PHP projects and install Laravel on Windows in a matter of minutes.

1.Installing XAMPP for Laravel

  • Download XAMPP for Windows from their official site: https://www.apachefriends.org/download.html
  • For our example, we’ve chosen PHP 7.1 and XAMPP 32 bit
  • Run the installer and select Apache, MySQL and phpMyAdmin
  • It’s recommended to make the installation in C:\ to avoid issues with Windows User permissions (or the drive where your Windows is installed)
  • After it’s complete do not start anything just yet.

2.Setting PHP from Windows CMD

  • Open Advanced System Settings (System Properties -> Advanced)
  • Open Environment Variables
  • On the top window select Path and click on Edit
  • In the new window click on New
  • We need to enter the path to XAMPP’s PHP

We will also add MySQL’s Path, click on New again and enter

C:\xampp\mysql\bin

3.Composer from Windows CMD

  • Download Composer’s Windows .exe installer: https://getcomposer.org/download/
  • Place the installer and run it from the added to Path directory –
C:\xampp\php

Now that we have Apache, PHP, MySQL and Composer installed, we’re ready to install Laravel, set a Virtual Host with a custom domain for local development. XAMPP’s Apache uses the htdocs folder for serving HTTP requests, we’ll set our custom Laravel Virtual Host under C:\xampp\htdocs\example\ which will be opened locally from example.com

4.Install Laravel on Windows with Composer

  • Open Window’s CMD or PowerShell
cd C:\xampp\htdocs

Install Laravel using Composer

composer create-project --prefer-dist laravel/laravel example

5.Creating MySQL Database for Laravel

  • Open the CMD or PowerShell again
  • Access the MySQL CLI
mysql -u root -p

Create Database for Laravel

CREATE DATABASE laravel DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;Code language: PHP (php)

6.Setting Laravel’s .env file

  • Navigate to C:\xampp\htdocs\example
  • Open the .env file and edit the MySQL Connection settings
DB_HOST=localhost
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

7.Virtual Host with XAMPP

  • Navigate to C:\xampp\apache\conf\extra
  • Open httpd-vhosts.conf and append:
NameVirtualHost *:80 
<VirtualHost example.com:80>
 DocumentRoot "C:\xampp\htdocs\example\public"
 ServerName example.com
 ServerAlias www.example.com
 <Directory "c:/xampp/htdocs/example/public">
 Require all granted </Directory>
 </VirtualHost>Code language: HTML, XML (xml)

8.Enable mod_rewrite for Laravel

  • Open the httpd.conf file in C:\xampp\apache\conf\extra
  • Look for LoadModule rewrite_module modules/mod_rewrite.so and remove the ; at the start

9.Setting local domain with hosts file

  • Navigate to c:\Windows\System32\Drivers\etc
  • Open the hosts file with Administrator Privileges
  • Append the line at the bottom
127.0.0.1 www.example.com example.comCode language: CSS (css)

Start Apache and MySQL, your local Laravel project will be opened from example.com and you’re ready to start working on it. When ready you can contact us to have it deployed on a WebHostFace server

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in advantage of affordability and ease.

Related Posts

Xampp Troubleshooting Guide

Log Levels of Apache, MySql, PHPMyAdmin, PHP, Composer Apache MySQL PHPMyAdmin PHPMyAdmin’s log level is primarily controlled by the PHP configuration, as it’s a PHP application. PHP…

Read More

Composer Install and Configuration Guide

Windows: Composer Install and Configuration Guide Prerequisite – XAMPP Step 1 – Download Composer package https://getcomposer.org/download/ Step 2 – Click on Composer-Setup.exe to start installer Step 3…

Read More

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-1

Step 1. Before creating the project firstly, we download all the setups. Composer XAMPP Visual Studio IDE Git Bash Here Step 2. Now open your Internet Browser…

Read More

How to Install Laravel Framework in Windows

By installing three software, we can work in Lvr, so let’s know which angle is the software which we can install Installing XAMPP Installing Composer Installing Laravel…

Read More

How to Install and create a project in Laravel for Windows User!

Before installing Laravel Composer, ensure that you have installed Xampp Server and Git-Bash. If not installed then go to this link and install:- xampp:- https://www.apachefriends.org/download.htmlGit-bash:- https://gitforwindows.org/ After…

Read More

How to Reset or Recover Forgotten mySql root Password

To reset a forgotten MySQL or MariaDB root password, stop the server, restart it with grant checks turned off (skip-grant-tables), set a new password with ALTER USER,…

Read More