How to install Laravel via Laravel Installer on Windows?

前端 未结 7 789
故里飘歌
故里飘歌 2020-12-12 11:25

I’m trying to install the Laravel Framework on Windows with the Laravel Installer method.

In the documentation I found the following:

7条回答
  •  离开以前
    2020-12-12 11:48

    The PATH for Windows:

    I’ve found the location where composer stores the Vendor files.

    So instead of ~/.composer/vendor/bin, on Windows the following path should be used:

    C:\Users\\AppData\Roaming\Composer\vendor\bin
    


    How to install the Laravel Installer:

    I assume you have php and composer in your PATH already.

    First of all install the Laravel Installer. Open a command prompt and enter:

    composer global require "laravel/installer=~1.1"
    


    Then update the PATH environment variable via e.g. command prompt with admin privileges:

    setx /M path "%path%;%appdata%\Composer\vendor\bin"
    

    %appdata% is added, so you don’t have to worry about adding your computer name.

    How to create a fresh Laravel Installation:

    Now you should be able to run laravel commands in the command prompt.

    To create a fresh laravel installation, open a command prompt in the directory of choice and enter:

    laravel new name_of_directory
    

    If everything went right, you should see the following message:

    Crafting application...
    Application ready! Build something amazing.

提交回复
热议问题