我的 CakePHP 3 项目需要更新以支持 PHP 8.1,但我无法让 Composer 更新正常工作。
每当我这样做时,我都会收到这些错误:
Problem 1
- cakephp/cakephp[3.9.0, ..., 3.9.3] require laminas/laminas-diactoros ^1.4.0 -> satisfiable by laminas/laminas-diactoros[1.4.0, ..., 1.8.7p2].
- cakephp/cakephp[3.8.0, ..., 3.8.13] require zendframework/zend-diactoros ^1.4.0 -> satisfiable by laminas/laminas-diactoros[1.4.0, ..., 1.8.7p2], zendframework/zend-diactoros[1.4.0, ..., 1.8.7].
- zendframework/zend-diactoros[1.4.0, ..., 1.4.1] require php ^5.4 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
- laminas/laminas-diactoros[1.4.0, ..., 1.4.1] require php ^5.4 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
- zendframework/zend-diactoros[1.5.0, ..., 1.8.7] require php ^5.6 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
- laminas/laminas-diactoros[1.5.0, ..., 1.8.7p2] require php ^5.6 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
- cakephp/cakephp[3.9.4, ..., 3.10.5] require php >=5.6.0,<8.0.0 -> your php version (8.1.10) does not satisfy that requirement.
- Root composer.json requires cakephp/cakephp ~3.8 -> satisfiable by cakephp/cakephp[3.8.0, ..., 3.10.5].
这是我的作曲家文件:
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=8.0",
"cakephp/cakephp": "~3.8",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*"
},
"require-dev": {
"psy/psysh": "@stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "~1.1"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"allow-plugins": {
"cakephp/plugin-installer": true
}
}
}
我可以毫无问题地执行作曲家安装命令。我也尝试过作曲家更新 --with-all-dependencies 但同样的问题。
有人对我能做些什么来解决这个问题有任何想法吗? 非常感谢:)
CakePHP 3 不支持 PHP 8。
版本图
CakePHP 核心 分行 PHP 分钟 PHP 最大 2.x 停产 2.x PHP 5.4 PHP 7.4 3.x 停产 3.x PHP 5.6 PHP 7.4 4.x 4.x / 4.下一个 PHP 7.2 最新 5.0(即将推出) 5.x PHP 8.1 最新 注意:PHP 8+ 与 CakePHP 4.2+ 兼容。