Install laravel and composerlaravel locally with composer in windows
Local Installation
First, make sure that PHP has been correctly installed. Open the command line php-v to check whether the correct version number is output.
Run the following commands to install the latest version of Composer:
Note: The Administrator mode is required.
Php-r "copy ('https: // getcomposer.org/installer', 'composer-setup. php ');"
Php composer-setup.php
Php-r "unlink ('composer-setup. php ');"
Then, the latest version of composer. phar file is automatically downloaded to the current directory.
Then, you will find a file named composer. phar in your directory.
Copy the composer. phar file to any directory (such as the root directory of your php project), and then use the php composer. phar command to use Composer!
For example, php composer. phar-version
Modify the global configuration file of composer
Open the command line window again
Note: The Administrator mode is required.
Php composer. phar config-g repo. packagist composer https://packagist.phpcomposer.com
Use Composer to download the Laravel installation package:
Composer global require "laravel/installer"
Add the PATH environment variable (the Composer folder, the specific PATH is subject to the personal computer)
C: \ Users \ User \ AppData \ Roaming \ Composer \ vendor \ bin
After the installation is complete, you can use the laravel new command to create a newly installed Laravel application in your specified directory.
For example, the laravel new blog command will create a directory named blog under the current directory, which stores the newly installed Laravel and all the dependent packages have been installed. The installation speed of this method is much faster than that of Composer.
Laravel new blog
You can also run the Composer Create-Project command to install Laravel.
Composer create-project laravel/laravel -- prefer-dist
Initialize laravel dependency package
Php composer. phar update