composer安装

composer安装的步骤

首先去http://www.phpcomposer.com/ 点击下载进入https://getcomposer.org/download/ 然后 点击 Composer-Setup.exe然后下载一个window下的composer安装软件

地址为 https://getcomposer.org/Composer-Setup.exe

下载后 点击安装 然后会选择php.ini版本 然后勾选 ,然后一路安装下去 有个长时间等待下载安装包,等待安装完成后,如果报错 就检查 PHP扩展的OpenSSL 有没有打开。

然后在cmd命令行中输入 composer 发现报错

复制代码
C:\Users\Administrator>composer
PHP Fatal error:  Uncaught exception 'PharException' with message 'phar "C:\ProgramData\ComposerSetup\bin\comp
oser.phar" has a broken signature' in C:\ProgramData\ComposerSetup\bin\composer.phar:23
Stack trace:
#0 C:\ProgramData\ComposerSetup\bin\composer.phar(23): Phar::mapPhar('composer.phar')
#1 {main}
  thrown in C:\ProgramData\ComposerSetup\bin\composer.phar on line 23

Fatal error: Uncaught exception 'PharException' with message 'phar "C:\ProgramData\ComposerSetup\bin\composer.
phar" has a broken signature' in C:\ProgramData\ComposerSetup\bin\composer.phar on line 23

PharException: phar "C:\ProgramData\ComposerSetup\bin\composer.phar" has a broken signature in C:\ProgramData\
ComposerSetup\bin\composer.phar on line 23

Call Stack:
    0.0015     328520   1. {main}() C:\ProgramData\ComposerSetup\bin\composer.phar:0
    0.0015     328608   2. Phar::mapPhar() C:\ProgramData\ComposerSetup\bin\composer.phar:23
复制代码

然后在网上找到了解决方案是替换覆盖C:\ProgramData\ComposerSetup\bin下的composer.phar包 下载地址为 https://getcomposer.org/download/1.0.0-alpha8/composer.phar 然后下载好了直接覆盖掉C:\ProgramData\ComposerSetup\bin\composer.phar即可

然后再次输入composer

即得到

复制代码
C:\Users\Administrator>composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.0.0-alpha8 2014-01-06 18:39:59

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose outpu
t and 3 for debug
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.
  --profile           Display timing and memory usage information
  --working-dir    -d If specified, use the given directory as working directory.

Available commands:
  about            Short information about Composer
  archive          Create an archive of this composer package
  config           Set config options
  create-project   Create new project from a package into given directory.
  depends          Shows which packages depend on the given package
  diagnose         Diagnoses the system to identify common errors.
  dump-autoload    Dumps the autoloader
  dumpautoload     Dumps the autoloader
  global           Allows running commands in the global composer dir ($COMPOSER_HOME).
  help             Displays help for a command
  init             Creates a basic composer.json file in current directory.
  install          Installs the project dependencies from the composer.lock file if present, or falls back on
the composer.json.
  licenses         Show information about licenses of dependencies
  list             Lists commands
  require          Adds required packages to your composer.json and installs them
  run-script       Run the scripts defined in composer.json.
  search           Search for packages
  self-update      Updates composer.phar to the latest version.
  selfupdate       Updates composer.phar to the latest version.
  show             Show information about packages
  status           Show a list of locally modified packages
  update           Updates your dependencies to the latest version according to composer.json, and updates the
 composer.lock file.
  validate         Validates a composer.json
复制代码

说明安装成功!

 

posted @   李照耀  阅读(2979)  评论(0编辑  收藏  举报
编辑推荐:
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示