Home >Backend Development >PHP Tutorial >composer update时报错:has a broken sugnature

composer update时报错:has a broken sugnature

WBOY
WBOYOriginal
2016-06-06 20:44:372051browse

项目使用composer进行包管理,但是进行包升级时报以下错误,该怎么解决?

<code>ubuntu@ubuntu-VGN-SR13-B:~/nginx/coolwifi$ composer selfupdate
PHP Fatal error:  Uncaught exception 'PharException' with message 'phar "/usr/local/bin/composer" has a broken signature' in /usr/local/bin/composer:13
Stack trace:
#0 /usr/local/bin/composer(13): Phar::mapPhar('composer.phar')
#1 {main}
  thrown in /usr/local/bin/composer on line 13
</code>

解决:删掉/usr/local/bin/composer后,重新下载composer.phar复制进去添加执行权限后正常

回复内容:

项目使用composer进行包管理,但是进行包升级时报以下错误,该怎么解决?

<code>ubuntu@ubuntu-VGN-SR13-B:~/nginx/coolwifi$ composer selfupdate
PHP Fatal error:  Uncaught exception 'PharException' with message 'phar "/usr/local/bin/composer" has a broken signature' in /usr/local/bin/composer:13
Stack trace:
#0 /usr/local/bin/composer(13): Phar::mapPhar('composer.phar')
#1 {main}
  thrown in /usr/local/bin/composer on line 13
</code>

解决:删掉/usr/local/bin/composer后,重新下载composer.phar复制进去添加执行权限后正常

看似权限不够,请试试:
> sudo composer self-update
or

<code>> sudo su
> composer self-update
</code>

似乎需要重新安装,请查看 issue on github.

Statement:
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