Installing Laravel on XAMPP
This post documents how to install Laravel locally using XAMPP. When you are developing with Laravel on an older computer or one with limited resources, using XAMPP for your local PHP and MySQL development server works well on Windows.
Laravel PHP Requirements
This table shows the minimum PHP version requirements for the latest versions of Laravel.
Laravel | PHP |
5.3 | 5.6.4 |
5.1, 5.2 | 5.5.9 |
5.0 * | 5.4 |
* PHP 7 not supported in this version
Head over to the Apache Freinds site to download the version of XAMPP that meets the minimum PHP requirements for the version of Laravel you are supporting. If you are developing in Laravel 5.2 currently and also want to be able to support Laravel 5.3, get the XAMPP version that includes PHP 7.
For Windows, I have xampp installed at the root directory on C:\ drive. here is the virtual hosts configuration I am using for Laravel. More information for setting up XAMPP on Windows.
httpd-vhosts.conf
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName laravel.dev
ServerAlias www.laravel.dev
SetEnv APPLICATION_ENV development
<Directory "C:/xampp/htdocs/laravel">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Edit C:\Windows\System32\drivers\etc\hosts file, mapping laravel.dev hostname to 127.0.0.1 localhost IP address.
hosts
127.0.0.1 laravel.dev
Install Laravel
This example will install laravel 5.2 into C:/xampp/htdocs/laravel using Composer. Use the create-project
command and the laravel/laravel package name followed by the directory to create the project in. The optional third argument is for a version number.
cd c:/xampp/htdocs
composer create-project laravel/laravel laravel "5.2.*"