【发布时间】:2020-11-30 02:06:03
【问题描述】:
在我的 Homestead 开发环境中,我尝试通过 php v7.1 安装一个名为 ralouphie/getallheaders 的作曲家包;它已成功完成。但是当我尝试通过 php v7.2 时,它不会安装该软件包;而是创建目录ralouphie/getallheaders 而不包含其内容。
现在,我不知道为什么没有通过 7.2 安装软件包。
更新:当我运行这个命令时:php7.1 $(which composer) require ralouphie/getallheaders -vvv,输出变成如下:
Reading ./composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/vagrant/code/Anonymous/experiment): git branch --no-color --no-abbrev -v
Executing command (/home/vagrant/code/Anonymous/experiment): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/home/vagrant/code/Anonymous/experiment): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/home/vagrant/code/Anonymous/experiment): hg branch
Executing command (/home/vagrant/code/Anonymous/experiment): fossil branch list
Executing command (/home/vagrant/code/Anonymous/experiment): fossil tag list
Executing command (/home/vagrant/code/Anonymous/experiment): svn info --xml
Reading /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/vendor/composer/installed.json
Loading plugin Hirak\Prestissimo\Plugin
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
1/11: http://repo.packagist.org/p/provider-latest$786c0a2de55894abbbe78d38ea8a7f8cb144a479657680c03f961f1424c8527b.json
2/11: http://repo.packagist.org/p/provider-2020-07$259946c1fbf2884ae74748db78723bde9e9ad15cdc6fb66c882d9c5a8d6b69e3.json
3/11: http://repo.packagist.org/p/provider-2014$4eccda8fcda875865caa21e02f44b68b04aabe8703dca0c33f97e3b2c875cc23.json
4/11: http://repo.packagist.org/p/provider-2019-10$0118bd0f4425f85122390c20789ca8974db07de59f318a7a32716c3b3b1fdb3c.json
5/11: http://repo.packagist.org/p/provider-2020-01$fff123ed297a9c51717b3620cc2df64a95f192d9cb2d2533505ba0333580fdb7.json
6/11: http://repo.packagist.org/p/provider-2015$336d1044409cd7cb78fa08dddb2cf8039f0ffd10e3bd3a4491ce878218a0043c.json
7/11: http://repo.packagist.org/p/provider-2016$48bce800c9590d0bddd9e52be42323c696cda4a25e598c6ffad96a2a8b394646.json
8/11: http://repo.packagist.org/p/provider-2020-04$bdd0ca73a9bde9a9eece92e985192223507ac0e0e61df1ef487eae3c16d78e1d.json
9/11: http://repo.packagist.org/p/provider-2017$91b0c72ad31434857805c37425563a5be8f6fad00c79100aed72317106e91a8d.json
10/11: http://repo.packagist.org/p/provider-2018$e848f828f037d4c7a59ef9f5c57bb4145552f2a65809b32933ba25cb6a221820.json
11/11: http://repo.packagist.org/p/provider-2019$177ae87a95a123b7b2b325c44f5efb94b2fbaeaba33239fffe010cec94f4c743.json
Finished: success: 11, skipped: 0, failure: 0, total: 11
Running 1.10.10 (2020-08-03 11:35:19) with PHP 7.1.33-16+ubuntu18.04.1+deb.sury.org+1 on Linux / 4.15.0-64-generic
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-01.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-04.json into cache
^BWriting /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-07.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/provider-ralouphie$getallheaders.json from cache
Using version ^3.0 for ralouphie/getallheaders
./composer.json has been updated
Reading ./composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file ./composer.json
Executing command (/home/vagrant/code/Anonymous/experiment): git branch --no-color --no-abbrev -v
Executing command (/home/vagrant/code/Anonymous/experiment): git describe --exact-match --tags
Executing command (/home/vagrant/code/Anonymous/experiment): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/home/vagrant/code/Anonymous/experiment): hg branch
Executing command (/home/vagrant/code/Anonymous/experiment): fossil branch list
Executing command (/home/vagrant/code/Anonymous/experiment): fossil tag list
Executing command (/home/vagrant/code/Anonymous/experiment): svn info --xml
Reading /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/vendor/composer/installed.json
Loading plugin Hirak\Prestissimo\Plugin_composer_tmp0
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
1/4: http://repo.packagist.org/p/provider-latest$eb9f98444c1864e0e3d84c7477cec3149da4201114560cbc6d8125859aeb33e1.json
2/4: http://repo.packagist.org/p/provider-2020-07$59bdd46b979080c87b3da8b15148152c2f1fc4eaba495fdcd7417fde75857c43.json
3/4: http://repo.packagist.org/p/provider-2020-01$da305ff39fe71daf7a4c7cd8b724246b0890976aed9cc2e3e711cd988bde37ad.json
4/4: http://repo.packagist.org/p/provider-2020-04$5c3949e643ed4d0e9543eac8fcd9ec6a0abbb773156a81d0cab000b218440a5a.json
Finished: success: 4, skipped: 0, failure: 0, total: 4
Loading composer repositories with package information
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cache
Downloading http://repo.packagist.org/p/provider-2020-01%24da305ff39fe71daf7a4c7cd8b724246b0890976aed9cc2e3e711cd988bde37ad.json
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-01.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-04.json into cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-07.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/provider-ralouphie$getallheaders.json from cache
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.000 seconds
Analyzed 103 packages to resolve dependencies
Analyzed 88 rules to resolve dependencies
Package operations: 1 install, 0 updates, 0 removals
Installs: ralouphie/getallheaders:3.0.3
- Installing ralouphie/getallheaders (3.0.3): Reading /home/vagrant/.composer/cache/files/ralouphie/getallheaders/ddc5f4c7ab3d868f5060717336a0d93475d53175.zip from cache
Loading from cache
Extracting archiveExecuting command (CWD): unzip -qq '/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b' -d '/home/vagrant/code/Anonymous/experiment/vendor/composer/7eebe120'
Failed to execute (9) unzip -qq '/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b' -d '/home/vagrant/code/Anonymous/experiment/vendor/composer/7eebe120'
[/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b or
/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b.zip, and cannot find /home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b.ZIP, period.
The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
Unzip with unzip command failed, falling back to ZipArchive class
Failed to download ralouphie/getallheaders from dist: Could not delete /home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders/a467de1e3835523e051c9df2e882c19b:
Now trying to download from source
- Installing ralouphie/getallheaders (3.0.3):
Cloning to cache at '/home/vagrant/.composer/cache/vcs/https---github.com-ralouphie-getallheaders.git/'
Executing command (/home/vagrant/.composer/cache/vcs/https---github.com-ralouphie-getallheaders.git/): git rev-parse --git-dir
Executing command (/home/vagrant/.composer/cache/vcs/https---github.com-ralouphie-getallheaders.git/): git rev-parse --quiet --verify '120b605dfeb996808c31b6477290a714d356e822^{commit}'
Cloning 120b605dfeb996808c31b6477290a714d356e822 from cache
Executing command (CWD): git clone --no-checkout '/home/vagrant/.composer/cache/vcs/https---github.com-ralouphie-getallheaders.git/' '/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders' --dissociate --reference '/home/vagrant/.composer/cache/vcs/https---github.com-ralouphie-getallheaders.git/' && cd '/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders' && git remote set-url origin 'https://github.com/ralouphie/getallheaders.git' && git remote add composer 'https://github.com/ralouphie/getallheaders.git'
Executing command (/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders): git remote set-url --push origin 'git@github.com:ralouphie/getallheaders.git'
Executing command (/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders): git branch -r
Executing command (/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders): git checkout '3.0.3' --
Executing command (/home/vagrant/code/Anonymous/experiment/vendor/ralouphie/getallheaders): git reset --hard '120b605dfeb996808c31b6477290a714d356e822' --
REASON: Required by the root package: Install command rule (install ralouphie/getallheaders 3.0.0|install ralouphie/getallheaders 3.0.1|install ralouphie/getallheaders 3.0.2|install ralouphie/getallheaders 3.0.3)
Reading /home/vagrant/code/Anonymous/experiment/vendor/composer/installed.json
Writing lock file
Generating autoload files
并且运行这条命令后:php7.2 $(which composer) require ralouphie/getallheaders -vvv,输出如下:
Reading ./composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/vagrant/code/Anonymous/experiment 2): git branch --no-color --no-abbrev -v
Executing command (/home/vagrant/code/Anonymous/experiment 2): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/home/vagrant/code/Anonymous/experiment 2): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/home/vagrant/code/Anonymous/experiment 2): hg branch
Executing command (/home/vagrant/code/Anonymous/experiment 2): fossil branch list
Executing command (/home/vagrant/code/Anonymous/experiment 2): fossil tag list
Executing command (/home/vagrant/code/Anonymous/experiment 2): svn info --xml
Reading /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/vendor/composer/installed.json
Loading plugin Hirak\Prestissimo\Plugin
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
1/3: http://repo.packagist.org/p/provider-latest$91e51fd20918010bc9eb6755005da77e51d4ca3343b3c7e78c29f228cf441572.json
2/3: http://repo.packagist.org/p/provider-2020-07$59bdd46b979080c87b3da8b15148152c2f1fc4eaba495fdcd7417fde75857c43.json
3/3: http://repo.packagist.org/p/provider-2020-04$5c3949e643ed4d0e9543eac8fcd9ec6a0abbb773156a81d0cab000b218440a5a.json
Finished: success: 3, skipped: 0, failure: 0, total: 3
Running 1.10.10 (2020-08-03 11:35:19) with PHP 7.2.22-1+ubuntu18.04.1+deb.sury.org+1 on Linux / 4.15.0-64-generic
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-01.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-04.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-07.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/provider-ralouphie$getallheaders.json from cache
Using version ^3.0 for ralouphie/getallheaders
./composer.json has been updated
Reading ./composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file ./composer.json
Executing command (/home/vagrant/code/Anonymous/experiment 2): git branch --no-color --no-abbrev -v
Executing command (/home/vagrant/code/Anonymous/experiment 2): git describe --exact-match --tags
Executing command (/home/vagrant/code/Anonymous/experiment 2): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/home/vagrant/code/Anonymous/experiment 2): hg branch
Executing command (/home/vagrant/code/Anonymous/experiment 2): fossil branch list
Executing command (/home/vagrant/code/Anonymous/experiment 2): fossil tag list
Executing command (/home/vagrant/code/Anonymous/experiment 2): svn info --xml
Reading /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file /home/vagrant/.composer/composer.json
Loading config file /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/auth.json
Reading /home/vagrant/.composer/vendor/composer/installed.json
Loading plugin Hirak\Prestissimo\Plugin_composer_tmp0
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Loading composer repositories with package information
Writing /home/vagrant/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-01.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-04.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-2020-07.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json from cache
Reading /home/vagrant/.composer/cache/repo/https---repo.packagist.org/provider-ralouphie$getallheaders.json from cache
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.000 seconds
Analyzed 103 packages to resolve dependencies
Analyzed 88 rules to resolve dependencies
Package operations: 1 install, 0 updates, 0 removals
Installs: ralouphie/getallheaders:3.0.3
- Installing ralouphie/getallheaders (3.0.3): Reading /home/vagrant/.composer/cache/files/ralouphie/getallheaders/ddc5f4c7ab3d868f5060717336a0d93475d53175.zip from cache
Loading from cache
Extracting archiveExecuting command (CWD): unzip -qq '/home/vagrant/code/Anonymous/experiment 2/vendor/ralouphie/getallheaders/fd45c27f2968e6a5a56e4f234ba908a4' -d '/home/vagrant/code/Anonymous/experiment 2/vendor/composer/d6184e5e'
Failed to execute (9) unzip -qq '/home/vagrant/code/Anonymous/experiment 2/vendor/ralouphie/getallheaders/fd45c27f2968e6a5a56e4f234ba908a4' -d '/home/vagrant/code/Anonymous/experiment 2/vendor/composer/d6184e5e'
[/home/vagrant/code/Anonymous/experiment 2/vendor/ralouphie/getallheaders/fd45c27f2968e6a5a56e4f234ba908a4]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /home/vagrant/code/Anonymous/experiment 2/vendor/ralouphie/getallheaders/fd45c27f2968e6a5a56e4f234ba908a4 or
/home/vagrant/code/Anonymous/experiment 2/vendor/ralouphie/getallheaders/fd45c27f2968e6a5a56e4f234ba908a4.zip, and cannot find /home/vagrant/code/Anonymous/experiment 2/vendor/ralouphie/getallheaders/fd45c27f2968e6a5a56e4f234ba908a4.ZIP, period.
The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
Unzip with unzip command failed, falling back to ZipArchive class
REASON: Required by the root package: Install command rule (install ralouphie/getallheaders 3.0.0|install ralouphie/getallheaders 3.0.1|install ralouphie/getallheaders 3.0.2|install ralouphie/getallheaders 3.0.3)
Reading /home/vagrant/code/Anonymous/experiment 2/vendor/composer/installed.json
Writing lock file
Generating autoload files
【问题讨论】:
-
发布该尝试的整个终端会话
-
我敢打赌,如果您查看终端中的输出,它会给您一个很大的线索
-
尝试将
-vvv添加到 composer install 调用中,并在此处发布安装的输出。 -
感谢您的即时回复。我已经添加了命令输出。
-
在 zip 命令之后似乎中断了。尝试
php -i | grep -i zip以确保已安装 zip 包。
标签: php composer-php