windows下 composer常見問題及處理

windows下 composer常見錯誤及處理。php

錯誤一:windows

Warning: This development build of composer is over 30 days old. It is recommendapi

ed to update it by running "C:\ProgramData\ComposerSetup\bin\composer.phar self-bash

update" to get the latest version.yii2

解決方法:
composer

composer selfupdate
yii

以下圖:ui

錯誤二:this

You are running composer with xdebug enabled. This has a major impact on runtimespa

 performance. See https://getcomposer.org/xdebug

如圖:

解決方法:

打開php.ini,在zend_extension前加分號

;zend_extension = "d:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"

見文檔:

https://getcomposer.org/doc/articles/troubleshooting.md#xdebug-impact-on-composer

錯誤三:

Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\V
ersionParser::parseLinks() in C:\Documents and Settings\Administrator\Applicatio
n Data\Composer\vendor\fxp\composer-asset-plugin\Repository\VcsPackageFilter.php
on line 272

解決辦法:

刪除composer資源插件,再從新安裝

Linux : rm -rf ~/.composer/vendor/fxp

Windows : rm -r %APPDATA%\Composer\vendor\fxp

從新安裝:

composer global require "fxp/composer-asset-plugin:~1.0.3"

若是還有其它錯誤,可嘗試全局更新:

composer global update

見參考:

http://stackoverflow.com/questions/32901750/why-do-i-get-php-fatal-error-when-i-want-to-install-an-extension

windows截圖以下:

錯誤四:

The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this *WIL L* break in the future and it should be fixed ASAP (require ^1.0 for example). The "fxp/composer-asset-plugin" plugin requires composer-plugin-api 1.0.0, this*WILL* break in the future and it should be fixed ASAP (require ^1.0 for example ).

解決辦法:

Yii2 須要 composer-plugin-api 1.0 以上的版本,運行如下命令:

composer global require "fxp/composer-asset-plugin:~1.1.1" 


更多信息參考:

composer 中文網:http://www.phpcomposer.com/

composer官網:https://getcomposer.org/doc/

相關文章
相關標籤/搜索