In this tutorial, we will show you how to install Laravel MVC skeleton application for your PHP development projects.
The following steps are for Windows OS only.
First, you must install XAMPP, please refer to another tutorial: Create local website on your PC.
Once XAMPP is installed, download and install Composer for Windows.
Composer should detect your PHP directory inside XAMPP during installation.
After installation, check that Composer is properly installed, by running the following command in Command Prompt.
Next, install Git for Windows.
Refer to our installation tutorial: Control your projects with Git.
For the next step, install the Laravel Installer globally, via Composer, running the following command in the Command Prompt:
composer global require laravel/installer
Finally, you must open Command Prompt from your web projects root directory, which should be:
And execute the following command:
laravel new [example-app]
Composer will download and install all the Laravel MVS Skeleton files from GitHub into specified directory on your computer and launch the installation process.
Once the installation is finished, you will have the new folder with your new application name created for you and you are ready to work.
Laravel has its own builtin web server, although this is rather for testing purposes and not to run your web application permanently.
To run it, type the following command from your application directory:
php artisan serve
In the next section, we will do something better.
Configure your URLs
Great, you have installed all needed components. Now it
is time to configure the access to your local Laravel website via browser.
1) Add the following lines to the
Note: Replace the file path with your own!
<VirtualHost *:80> DocumentRoot "D:/xampp/htdocs" ServerName localhost </VirtualHost> <VirtualHost *:80> ServerName localhost.laravel.com DocumentRoot D:\xampp\htdocs\laravel\public SetEnv APPLICATION_ENV "development" <Directory D:\xampp\htdocs\laravel\public> DirectoryIndex index.php AllowOverride All Require all granted </Directory> </VirtualHost>
Add the following line to the
Now restart you Apache server from XAMPP.
Navigate to your site in browser:
You must see the following page: