1. 程式人生 > >windows下 composer常見錯誤及處理。

windows下 composer常見錯誤及處理。

windows下 composer常見錯誤及處理。

2016年12月22日 20:40:37

閱讀數:1501

windows下 composer常見錯誤及處理。
錯誤一:
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "C:\ProgramDat\ComposerSetup\bin\composer.phar self-update" to get the latest version.
解決方法:
composer selfupdate

錯誤二:
You are running composer with xdebug enabled. This has a major impact on runtime
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"

錯誤三:
Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\ VersionParser::parseLinks() in C:\Documents and Settings\Administrator\Application 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

錯誤四:
[Composer\Downloader\TransportException]
Your configuration does not allow connection to http://ooxx/xxoo.git. See https://getcomposer.org/doc/06-config.md#secure-http for details.

解決方法是設定一個本地或全域性的composer配置:
composer config secure-http false
全域性設定:
composer config -g secure-http false
意義是預設禁用https請求,就可以了

錯誤五:
[Composer\Excepion\NoSslException]

The openssl extension is required for SSL/TLS protection but is not availab le. If you can not enable the openssl extension, you can disable this error , at your own risk, by setting the '...

解決方法

把php的ssl開啟
composer config -g -- disable-tls true

錯誤六
[RuntimeException]
You must enable the openssl extension in your php.ini to load information from https://packagist.phpcomposer.com
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-pa
ckages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...
解決方法
php.ini OpenSSL擴充套件開啟
extension=php_openssl.dll

 

原:https://blog.csdn.net/fatong3/article/details/53819787