Home » Php » How do I install Laravel from phar file?

How do I install Laravel from phar file?

Posted by: admin November 29, 2017 Leave a comment


I downloaded the laravel.phar file, renamed it to laravel, moved it to /usr/local/bin, then made it executable by all.

In my home directory, I tried laravel new sandbox, but nothing happens.

What did I do wrong?



Do not bother renaming the file, and do not bother with /usr/local/bin. Just place laravel.phar in the folder where you are going to use it.

Then make sure you have the PHP curl module installed. On OpenSuse:

sudo zypper install php5-curl

Then create your new Laravel application with the following command (notice you use the php command to execute the .phar file):

php laravel.phar new <project-name> 

e.g. php laravel.phar new sandbox. A new subfolder
will be created with the project-name as its name, containing the skeleton of a Laravel application.


Or just run:

curl -O http://laravel.com/laravel.phar && chmod +x laravel.phar && mv laravel.phar /usr/local/bin/laravel


This method worked for me.

  1. Create batch script and name it laravel.bat
  2. Paste the following codes in your laravel.bat file


php “%~dp0laravel.phar” %*

3.Store the laravel.bat file in the same directory as the downloaded PHAR file (laravel.phar)

4.Include the directory path in your environmental variables.

Then you are good to go…. just launch CMD and test it by typing laravel then hit return