windows下 composer常见错误及处理。

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
在重新安装 Composer 过程中,可能会遇到以下常见错误: 1. "Could not open input file: composer.phar" - 这个错误通常是由于在命令中使用了错误的文件路径,或者没有在命令中指定正确的 Composer 文件名。确保你在命令中正确地指定了 Composer 文件的位置和名称。 2. "The following exception is caused by a lack of memory or swap, or not having swap configured" - 这个错误通常是由于你的服务器上没有足够的内存或交换空间来运行 Composer。你可以尝试增加服务器的内存或交换空间,或者在运行 Composer 命令时使用 --prefer-dist 标志来减少内存使用。 3. "Installation failed, reverting ./composer.json to its original content." - 这个错误通常是由于 Composer 在安装依赖项时遇到了错误。你可以查看 Composer 的输出信息来查找出错的原因,并尝试重新运行安装命令。 4. "Composer detected issues in your platform: Your Composer dependencies require a PHP version " - 这个错误通常是由于你的 PHP 版本不符合 Composer 依赖项的要求。你可以尝试升级 PHP 版本,或者在运行 Composer 命令时使用 --ignore-platform-reqs 标志来忽略版本要求。 5. "The requested PHP extension ext-xxx * is missing from your system." - 这个错误通常是由于你的系统缺少必需的 PHP 扩展,需要手动安装扩展或启用扩展。你可以通过搜索相关的扩展以及安装方法来解决问题。 希望这些信息对你有所帮助!
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黑漆#000000

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值