【发布时间】:2017-05-27 17:57:19
【问题描述】:
我有一个 PHP 项目,其文件夹结构如下:
C:\Users\Bas\Documents\Web_development\Projects\Back_end\Current\Project_name\Workspace
我已经为这个项目安装了 composer,并且已经安装了一些包。我的 composer.json 看起来像这样:
{
"name": "Bas/Project_name",
"description": "...",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Bas",
"email": "..."
}
],
"require": {
"psr/log": "1.0.2",
"monolog/monolog": "1.22.0",
"ip2location/ip2location-php": "8.0.2"
}
}
当我尝试安装 phpunit/phpunit 版本 5.7.x(最新)软件包时,它给了我 [ErrorException] ZipArchive::extractTo(): Full extraction path exceed MAXPATHLEN (260) 错误。完整的错误消息如下所示:
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Using version ^5.7 for phpunit/phpunit
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing symfony/yaml (v3.2.1)
Loading from cache
- Installing sebastian/version (2.0.1)
Loading from cache
- Installing sebastian/resource-operations (1.0.0)
Loading from cache
- Installing sebastian/recursion-context (2.0.0)
Loading from cache
- Installing sebastian/object-enumerator (2.0.0)
Loading from cache
- Installing sebastian/global-state (1.1.1)
Loading from cache
- Installing sebastian/exporter (2.0.0)
Loading from cache
- Installing sebastian/environment (2.0.0)
Loading from cache
- Installing sebastian/diff (1.4.1)
Loading from cache
- Installing sebastian/comparator (1.2.2)
Loading from cache
- Installing doctrine/instantiator (1.0.5)
Loading from cache
- Installing phpunit/php-text-template (1.2.1)
Loading from cache
- Installing phpunit/phpunit-mock-objects (3.4.3)
Downloading: 100%
Installation failed, reverting ./composer.json to its original content.
[ErrorException]
ZipArchive::extractTo(): Full extraction path exceed MAXPATHLEN (260)
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-packages] [-o|--optimize-autoloader] [-a|--classmap-autho
ritative] [--] [<packages>]...
我正在使用composer require phpunit/phpunit 命令安装包。
我对这个问题做了一些研究,这是由于目录结构过长造成的,但是当计算我当前的目录结构时,它只有87个字符。
我尝试使用--prefer-source 参数运行composer install 和composer update 命令。这两个都不起作用,给了我同样的错误。
我目前正在运行 Windows 10 64 位。
这个问题是怎么发生的?因为我在MAXPATHLEN (260) 变量下有一个目录结构。
有什么方法可以在不改变我的目录结构的情况下解决这个问题?
【问题讨论】:
标签: php phpunit composer-php