composer 第4章 问题集锦 composer 第4章 问题集锦

2023-02-28

一、错误一

报错:

Warning: This development build of composer is over 30 days old. It is recommended to update it by running "C:\ProgramData\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

解决方法:

composer self-update

三、错误三

报错:

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 -r %APPDATA%\Composer\vendor\fxp
安装——composer global require "fxp/composer-asset-plugin:~1.0.3"

四、错误四

报错:

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"

五、错误五

报错:

[ErrorException] zlib_decode(): data error

解决方法:

执行 composer self-update 即可

六、错误六

报错:

在执行迁移或者数据填充时发生「class not found」错误

解决方法:

试着先执行 composer dump-autoload 命令后再进行一次

七、错误七

报错:

Problem 1
    - The requested package graham-campbell/credentials ~1.0 is satisfiable by g
raham-campbell/credentials[1.0.x-dev] but these conflict with your requirements
or minimum-stability.

解决方法:

在composer.json中添加以下(如果存在则修改)
"minimum-stability": "dev",

八、错误八

报错:

如果不需要使用https,可以这么写,以解决有时候因为 https 造成的问题

解决方法:

composer config -g secure-http false

九、错误九

报错:

composer update 或者 composer install提示killed解决办法
出现此原因大多因为缓存不足造成,在linux环境可增加缓存解决。

解决方法:

free -m
mkdir -p /var/_swap_
cd /var/_swap_
#Here, 1M * 2000 ~= 2GB of swap memory
dd if=/dev/zero of=swapfile bs=1M count=2000
mkswap swapfile
swapon swapfile
echo “/var/_swap_/swapfile none swap sw 0 0” >> /etc/fstab
#cat /proc/meminfo
free -m

十、错误十

报错:

安装Composer报错error:14090086:SSL routines:ssl3_get_server_certificate解决方法

解决方法:

yum install -y ca-certificates

如果上述安装还没有解决,请继续操作:

下载证书http://curl.haxx.se/ca/cacert.pem
wget http://curl.haxx.se/ca/cacert.pem
或者使用网页下载再上传至linux
mkdir -p /usr/local/openssl/ssl/certs/
mv cacert.pem /usr/local/openssl/ssl/certs/cacert.pem
修改php.ini
;openssl.capath=
openssl.cafile=/usr/local/openssl/ssl/certs/cacert.pem

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开微信扫一扫,即可进行扫码打赏哦

阅读 279