Home > Development Tools > composer > Solve the problem that composer command cannot be used under git-bash

Solve the problem that composer command cannot be used under git-bash

藏色散人
Release: 2021-05-19 14:21:06
forward
2397 people have browsed it

下面由composer教程栏目给大家介绍解决git-bash下composer命令无法使用的问题,希望对需要的朋友有所帮助!

Solve the problem that composer command cannot be used under git-bash

git-bash下composer命令无法使用的问题

已经安装composer,写好composer.bat,并且设置好了path,在cmd下可以正常使用,但是在git-bash里面不行,其实真正的原因是,git-bash 不识别 composer.bat 文件,需要新建一个 composer 文件,输入如下内容:

#!/usr/bin/env sh
 
# php /path/to/composer.phar $*
php `dirname $0`/composer.phar $*
Copy after login

#!/usr/bin/env sh 有个这一行,git-bash 会自动识别为可执行文件,不需要也不能使用 chmod 命令修改权限。

The above is the detailed content of Solve the problem that composer command cannot be used under git-bash. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
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