我正在尝试安装 DomPDF 以与我的 Symfony 6.1.3 项目一起使用。我正在使用作曲家(作曲家需要 dompdf/dompdf)。 然而,它(它的一些依赖项)似乎不支持 PHP 8.2。
您的要求无法解决为一组可安装的 包裹。
问题1 - laminas/laminas-code 4.6.0 需要 php >=7.4,<8.2 -> 您的 php 版本 (8.2.4) 不满足该要求。 - symfony/proxy-manager-bridge v6.1.0 需要 Friendsofphp/proxy-manager-lts ^1.0.2 -> 可满足 Friendsofphp/proxy-manager-lts[v1.0.12]。 - Friendsofphp/proxy-manager-lts v1.0.12 需要 laminas/laminas-code ~3.4.1|^4.0 -> 可满足 层压板/层压板代码[4.6.0]。 - symfony/proxy-manager-bridge 已锁定到版本 v6.1.0,并且未请求更新此软件包。
您还可以尝试使用显式版本重新运行composer require 约束,例如“作曲家需要 dompdf/dompdf:*” 来确定是否 任何版本都可以安装,或者“composer require dompdf/dompdf:^2.1” 如果您知道自己需要哪个。
安装失败,将 ./composer.json 和 ./composer.lock 恢复为 他们的原创内容。
DomPDF Github 页面上显示您需要 7.1 或更高版本。 我是否在监督某些事情,或者我是否必须降级我的 php 版本?
我的composer.json
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.0.2",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "^2.6",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.12",
"sensio/framework-extra-bundle": "^6.2",
"symfony/console": "6.1.*",
"symfony/dotenv": "6.1.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "6.1.*",
"symfony/mailer": "6.1.*",
"symfony/proxy-manager-bridge": "6.1.*",
"symfony/runtime": "6.1.*",
"symfony/security-bundle": "6.1.*",
"symfony/twig-bundle": "6.1.*",
"symfony/uid": "6.1.*",
"symfony/yaml": "6.1.*"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"symfony/flex": true,
"symfony/runtime": true
},
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.1.*"
}
},
"require-dev": {
"symfony/maker-bundle": "^1.40"
}
}
En estos casos es necesario descargar y instalar en la raiz composer.phar
lo puedes encontrar aquí https://getcomposer.org/download/
para luego solamente ejecutar el comando.
/bin/php7.2composer.phar 需要 dompdf/dompdf。