Search code examples
phplaravelinstallationlaravel-4phar

How do I install Laravel from phar file?


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?

Thanks.


Solution

  • 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.