composer问题集合

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34193883/article/details/82381398

windows下 composer常见错误及处理。

错误一:

 Warning: This development build of composer is over 30 days old. It is recommended 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资源插件,再重新安装

rm -rf ~/.composer/vendor/fxp  ##linux
rm -r %APPDATA%\Composer\vendor\fxp  ##windows

重新安装:

 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 '...

解决方法:

composer config -g -- disable-tls true  #把php的ssl开启

错误六:

[RuntimeException]

You must enable the openssl extension in your php.ini to load information from https://packagist.phpcomposer.com require --dev --prefer-dist 
--no-update [--update-no-dev] 
--update-with-dependencies [--prefer-stable] [--prefer-lowest] [--sort-packages] -o|--optimize-autoloader --...

解决方法:

php.ini OpenSSL扩展打开

extension=php_openssl.dll

错误七:

 [Composer\Exception\NoSslException]
  The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex
  tension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [<version>]

解决方法:

composer config -g -- disable-tls true

错误八:

[Composer\Downloader\TransportException]
  Your configuration does not allow connections to http://getcomposer.org/versions. See https://getcomposer.org/doc/0
  6-config.md#secure-http for details.

self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [<version>]

解决方法:

composer config secure-http false
composer config secure-http false

猜你喜欢

转载自blog.csdn.net/qq_34193883/article/details/82381398