Composer最小稳定性问题主要指的是,在使用Composer安装某个特定的依赖包时,可能会出现一些不稳定的情况,比如依赖包的版本号发生变化,或者依赖包的某些功能发生变化,这样就会导致应用程序出现问题。为了解决这个问题,Composer提供了一种机制,即“最小稳定性”,它可以确保安装的依赖包的版本号不会发生变化,从而确保应用程序的稳定性。
1.问题: composer update 提示稳定性版本问题,在使用composer install --ignore-platform-reqs 安装时,报错平
Failed to download myclabs/deep-copy from dist: The zip extension and unzip/7z commands are both missing,
因为没有安装zip包,安装这个
yum install zip unzip
2.问题: 重新执行composer install --ignore-platform-reqs
报错
Install of phpunit/phpunit failed
The following exception is caused by a process timeout
Check https://getcomposer.org/doc/06-config.md#process-timeout for details
In Process.php line 1204:
The process "'/usr/bin/unzip' -qq '/home/wwwroot/www/api/vendor/composer/tmp-7f97de9cf9ae2cfe17a2464140c0c913' -d '/home/wwwroot/www/api/vendor/composer/0d114510'" exceeded the timeout of 300 seconds.
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
composer install 超时问题,为什么COMPOSER PHP在300秒后安装超时,修改超时时间,
- Installing phar-io/manifest (2.0.3): Extracting archive
- Installing myclabs/deep-copy (1.11.0): Extracting archive
- Installing phpunit/phpunit (10.0.14): Extracting archive
- Installing spatie/backtrace (1.4.0): Extracting archive
- Installing spatie/flare-client-php (1.3.5): Extracting archive
- Installing spatie/ignition (1.4.5): Extracting archive
- Installing spatie/laravel-ignition (2.0.0): Extracting archive
115/117 [===========================>] 98% Install of laravel/framework failed
Install of phpunit/phpunit failed
The following exception is caused by a process timeout
Check https://getcomposer.org/doc/06-config.md#process-timeout for details
In Process.php line 1204:
The process "'/usr/bin/unzip' -qq '/home/wwwroot/www/api/vendor/composer/tmp-d6cf7c905ec840a52a032588e4f1a9c0' -d '/home/wwwroot/www/api/vendor/composer/0b3d384c'" exceeded the timeout of 300 seconds.
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
尝试composer update/install -o -vvv并检查包是从composer php的caching加载。
如果是,请尝试清除作曲者的caching或尝试添加-cache-dir=/dev/null 。
要强制下载档案而不是克隆源,请将--prefer-dist选项与--no-dev结合使用。
否则,你可以尝试提高composer php的过程超时值:
export COMPOSER_PROCESS_TIMEOUT=600 ( defaults to 300 )
composer php本身对允许远程git操作的时间有限制。 查看Composer文档可以确认,环境variablesCOMPOSER_PROCESS_TIMEOUT控制着这一点。 该variables设置为默认值300(秒),这显然不足以使用较慢的Internet连接进行大型克隆操作。
使用以下方法提高此值:
COMPOSER_PROCESS_TIMEOUT=2000 composer install
composer config --global process-timeout 2000 #修改时间
删除composer phpcaching为我工作。
rm -rf ~/.composer/cache/*
修改超时时间后,compsoser 安装成功