一般来说,有这样一个问题,在一个在docker上工作的项目中,我写了一个通过composer下载插件的脚本文件,看起来是这样的:
docker exec -ti php sh -c "cd var/www/project/apps/tele2 && composer install"
一般来说,没什么复杂的,我们进入容器,将自己拖到所需的文件夹并下载指示的所有内容。问题本身是有很多图书馆,一段时间后我发现了一个错误。但是,如果您手动执行所有这些操作,则不会出现错误,并且所有内容都可以很好地下载。你怎么能解决这样一个奇怪的问题?
错误如下所示:
- Installing vlucas/phpdotenv (v2.6.9): Extracting archive
- Installing opis/closure (3.6.2): Extracting archive
- Installing yiisoft/yii2-debug (2.1.18): Extracting archive
- Installing phpspec/php-diff (v1.1.3): Extracting archive
- Installing yiisoft/yii2-gii (2.2.3): Extracting archive
37/75 [=============>--------------] 49% Install of bower-asset/font-awesome failed
Install of mpdf/mpdf failed
Install of bower-asset/jquery-ui failed
Install of bower-asset/bootstrap failed
Install of phpoffice/phpspreadsheet failed
Install of goodby/csv failed
Install of imagine/imagine failed
Install of bower-asset/sweetalert failed
Install of symfony/process 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 '/var/www/project/apps/tele2/app/vendor/composer/tmp-a8ffef473a25eb18ded9c8fc075e9091' -d '/var/www/project/apps/tele2/app/vendor/composer/b231a75c'" exceeded the timeout of 300 seconds.
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-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>...]
我建议你修复容器中的 php.ini,设置更多超时。