In Laravel's installation documentation, they explain that in order to add the Laravel installer globally, you must put the directory in your PATH, but they don't explain how to do this.
Now we will introduce to you how to set the PATH path:
For Mac / Linux
Depending on the shell you are using, add the following to the .bash_profile, .bashrc, or .zshrc file:
export PATH=∼/.composer/vendor/bin:$PATH
For PC
Make sure you have Administrator permissions, and must use one of the following two commands:
setx /M path “%path%;%appdata%Composer\vendor\bin” set PATH=%PATH%;%USERPROFILE%AppDataRoamingComposer\vendor\bin
When you install the laravel installer globally, it is added to a location on the server, so when you set the path, in fact The purpose is to make your server aware of this directory, so when you run the command: laravel new project, it will find the laravel executable file from the composer/bin/ directory.
Recommended: "PHP Tutorial"http://www.php.cn/course/list/29.html
This article This is an introduction on how to set the Laravel Composer Bin directory path. It is simple and easy to understand. I hope it will be helpful to friends in need!
The above is the detailed content of How to set Laravel Composer Bin directory path. For more information, please follow other related articles on the PHP Chinese website!