phpspreadsheet 作曲家没有安装

phpspreadsheet composer not installing

我在本地 运行 composer 生成必要的文件,然后我将这些文件单独部署到服务器。所以我是 运行:

composer require phpoffice/phpspreadsheet --ignore-platform-reqs

但是,它失败了:

Problem 1
    - The requested package phpoffice/phpspreadsheet No version set (parsed as 1.0.0) is satisfiable by phpoffice/phpspreadsheet[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.

我对作曲家不熟悉。我已经通过将 "phpoffice/phpspreadsheet":"^1.0" 添加到 composer.json 来尝试此处建议的解决方案 https://github.com/google/google-api-php-client/issues/971,但这没有用。我也试过将最低稳定性设置为 dev 但没有成功。

有人可以帮忙吗?

编辑更多信息***

我安装了 PHP 7.2,完整版。json 与 https://github.com/PHPOffice/PhpSpreadsheet

提供的相同

这里:

{
    "name": "phpoffice/phpspreadsheet",
    "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
    "keywords": ["PHP", "OpenXML", "Excel", "xlsx", "xls", "ods", "gnumeric", "spreadsheet"],
    "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
    "type": "library",
    "license": "LGPL-2.1-or-later",
    "authors": [
        {
            "name": "Maarten Balliauw",
            "homepage": "http://blog.maartenballiauw.be"
        },
        {
            "name": "Mark Baker",
            "homepage": "http://markbakeruk.net"
        },
        {
            "name": "Franck Lefevre",
            "homepage": "http://rootslabs.net"
        },
        {
            "name": "Erik Tilt"
        }
    ],
    "scripts": {
        "check": [
            "php-cs-fixer fix --ansi --dry-run --diff",
            "phpcs --report-width=200 --report-summary  --report-full samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n",
            "phpunit --color=always"
        ],
        "fix": [
            "php-cs-fixer fix --ansi"
        ]
    },
      "require": {
        "php": "^5.6|^7.0",
        "ext-ctype": "*",
        "ext-dom": "*",
        "ext-gd": "*",
        "ext-iconv": "*",
        "ext-libxml": "*",
        "ext-mbstring": "*",
        "ext-SimpleXML": "*",
        "ext-xml": "*",
        "ext-xmlreader": "*",
        "ext-xmlwriter": "*",
        "ext-zip": "*",
        "ext-zlib": "*",
        "psr/simple-cache": "^1.0"
    },
    "require-dev": {
        "tecnickcom/tcpdf": "^6.2",
        "squizlabs/php_codesniffer": "^2.7",
        "phpunit/phpunit": "^5.7",
        "dompdf/dompdf": "^0.8.0",
        "mpdf/mpdf": "^7.0.0",
        "jpgraph/jpgraph": "^4.0",
        "friendsofphp/php-cs-fixer": "@stable"
    },
    "suggest": {
        "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
        "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
        "tecnick.com/tcpdf": "Option for rendering PDF with PDF Writer",
        "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
    },
    "autoload": {
        "psr-4": {
            "PhpOffice\PhpSpreadsheet\": "src/PhpSpreadsheet"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "PhpOffice\PhpSpreadsheetTests\": "tests/PhpSpreadsheetTests"
        }
    }
}

好的,所以这个答案是给其他任何发现这个作曲家新手的人的:

我假设 composer 会访问我已经从 GIT 下载的本地文件来配置所有内容。所以我 运行 在库源目录中使用 composer 命令。

这不是它的工作原理。您需要从您的项目目录中 运行 composer 命令,它将通过互联网拉取文件并 'install' 它们在您的项目目录结构中。