无法在php 7.2.9中使用composer安装mpdf

时间:2018-09-27 12:00:50

标签: php laravel composer-php mpdf

我正在尝试使用composer命令安装mpdf: 作曲者需要mpdf / mpdf

但我遇到此错误:

Problem 1
    - Conclusion: don't install mpdf/mpdf v7.1.5
    - Conclusion: don't install mpdf/mpdf v7.1.4
    - Conclusion: don't install mpdf/mpdf v7.1.3
    - Conclusion: don't install mpdf/mpdf v7.1.2
    - Conclusion: don't install mpdf/mpdf v7.1.1
    - Conclusion: remove setasign/fpdi v2.1.0
    - Installation request for mpdf/mpdf ^7.1 -> satisfiable by mpdf/mpdf[v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.1.4, v7.1.5].
    - Conclusion: don't install setasign/fpdi v2.1.0
    - mpdf/mpdf v7.1.0 requires setasign/fpdi 1.6.* -> satisfiable by setasign/fpdi[1.6.0, 1.6.1, 1.6.2].
    - Can only install one of: setasign/fpdi[1.6.0, v2.1.0].
    - Can only install one of: setasign/fpdi[1.6.1, v2.1.0].
    - Can only install one of: setasign/fpdi[1.6.2, v2.1.0].
    - Installation request for setasign/fpdi (locked at v2.1.0) -> satisfiable by setasign/fpdi[v2.1.0].

安装失败,将./composer.json恢复为其原始内容。

这是我的composer.json

{
  "lynx39/lara-pdf-merger": "1.0.*",
  "name": "laravel/laravel",
  "description": "The Laravel Framework.",
  "keywords": [
    "framework",
    "laravel"
  ],
  "license": "MIT",
  "type": "project",
  "require": {
    "php": "^7.1.3",
    "codedge/laravel-fpdf": "^1.2",
    "crabbly/fpdf-laravel": "^1.0",
    "cyber-duck/laravel-excel": "^1.2",
    "dompdf/dompdf": "^0.8.2",
    "fideloper/proxy": "^4.0",
    "jurosh/pdf-merge": "^2.0",
    "laravel/framework": "5.6.*",
    "laravel/passport": "^7.0",
    "laravel/tinker": "^1.0",
    "maatwebsite/excel": "^3.0",
    "mpdf/mpdf": "^7.1",
    "paragonie/random_compat": "2.*",
    "phpoffice/phpspreadsheet": "^1.4",
    "phpoffice/phpword": "^0.15.0",
    "rguedes/pdfmerger": "^1.0",
    "setasign/fpdi-fpdf": "^2.0",
    "tecnickcom/tc-lib-pdf": "dev-master"
  },
  "require-dev": {
    "filp/whoops": "^2.0",
    "fzaninotto/faker": "^1.4",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^2.0",
    "phpunit/phpunit": "^7.0"
  },
  "autoload": {
    "classmap": [
      "database/seeds",
      "database/factories"
    ],
    "psr-4": {
      "App\\": "app/"         }     },     "autoload-dev": {         "psr-4": {             "Tests\\": "tests/"         }     },     "extra": {         "laravel": {             "dont-discover": [             ]         }     },     "scripts": {         "post-root-package-install": [             "@php-r\"file_exists('.env') || copy('.env.example', '.env');\""
],
  "post-create-project-cmd": [
    "@php artisan key:generate"
  ],
  "post-autoload-dump": [
    "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
    "@php artisan package:discover"
  ]
},
  "config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
  },
  "minimum-stability": "dev",
  "prefer-stable": true
}

任何解决方案?

1 个答案:

答案 0 :(得分:0)

mPDF与版本2.x中的setasign / fpdi不兼容-使用版本1.6。