gpt4 book ai didi

php - 如何更新在 Ubuntu 上不工作的 zend-framework

转载 作者:太空宇宙 更新时间:2023-11-03 17:07:26 24 4
gpt4 key购买 nike

我在 ubuntu 上使用 zend-framework,不知何故我得到了这个错误:

Fatal error: Declaration of Zend\Mvc\Controller\PluginManager::get($name, ?array $options = NULL) must be compatible with Zend\ServiceManager\AbstractPluginManager::get($name, $options = Array, $usePeeringServiceManagers = true) in /home/nginad/upload/vendor/zendframework/zend- mvc/src/Controller/PluginManager.php on line 0

我检查了两个文件,参数不一样,我还在 github 下的 servicemanager 和 mvc 下检查了 zend-framework 3,两个文件具有相同的参数。

所以我需要更新 zend-framework 以与 php7.2 兼容,但不确定如何正确执行,我使用了 apt install composer。

当我进一步安装 zend-framework 时使用:composer require zendframework/...

它说:

问题 1

  • phpunit/phpunit 4.8.27 需要 ext-dom * -> 请求的 PHP 扩展您的系统中缺少 dom。
  • phpunit/phpunit 4.8.27 需要 ext-dom * -> 请求的 PHP 扩展您的系统中缺少 dom。
  • phpunit/phpunit 4.8.27 需要 ext-dom * -> 请求的 PHP 扩展您的系统中缺少 dom。
  • phpunit/phpunit == 4.8.27.0 的安装请求 -> 可满足phpunit/phpunit[4.8.27].

当我进一步安装 zend-framework 时:

composer require zendframework/...

它说:

Problem 1
- phpunit/phpunit 4.8.27 requires ext-dom * -> the requested PHP extension
dom is missing from your system.
- phpunit/phpunit 4.8.27 requires ext-dom * -> the requested PHP extension
dom is missing from your system.
- phpunit/phpunit 4.8.27 requires ext-dom * -> the requested PHP extension
dom is missing from your system.
- Installation request for phpunit/phpunit == 4.8.27.0 -> satisfiable by
phpunit/phpunit[4.8.27].

To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

最佳答案

我遇到了类似的问题,但是在安装 php7.1-bcmatch 和 php7.1-xml 后,将 Magento2 与 php7.1 一起使用,问题就解决了。

确保您还安装了 zend 框架中常用的这些扩展:php7.1-mbstringphp7.1-mcryptphp7.1-cliphp7.1-jsonphp7.1-curl

关于php - 如何更新在 Ubuntu 上不工作的 zend-framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48656625/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com