6.3. Installing Laravel

Before installing Laravel, make sure that your system environment meets the requirements.

  • PHP >= 5.5.9

  • PDO extension

  • MCrypt extension

  • OpenSSL extension

  • Mbstring extension

  • Tokenizer extension

6.3.1. Installing Composer

Laravel uses Composer to manage dependencies. Install Composer first and then install Laravel.

The easiest way to install Composer on Windows is by downloading and running the installation file: Composer-Setup.exe. The installation wizard will install Composer and configure PATH so that you can run Composer from the command line in any directory.

If you need to install Composer manually, go to https://getcomposer.org/download/ and pick up a fresh installation script that will do as follows:

  • Downloads the installation file to the current directory

  • Checks the installation file using SHA-384

  • Runs the installation script

  • Removes the installation script

Caution

Because this script changes with each new version of the installer, you will always need to have the latest version when reinstalling.

After you run the script, the composer.phar file will appear. The .phar extension marks an archive but, actually, it is a PHP script that can understand only a few commands (install, update, …​) and can download and unpack libraries.

Windows

If you are working in Windows, you can make it easier to work with Composer by creating the composer.bat file. Run the following command:

  1. echo @php “%~dp0composer.phar %*>composer.bat

Then set up your PATH so that you can just call composer from any directory in your command shell.

More details about installing Composer are available here.

6.3.2. Installing Laravel

Now, to install Laravel:

  1. composer global require "laravel/installer"