Home > Backend Development > PHP Tutorial > How to set Laravel Composer Bin directory path

How to set Laravel Composer Bin directory path

藏色散人
Release: 2023-04-05 10:22:01
Original
3267 people have browsed it

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.

How to set Laravel Composer Bin directory path

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template