1
votes

I am using zend-framework on ubuntu, somehow I got this error:

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

I checked tow files, it's not same parameters, I also checked zend-framework 3 at github under servicemanager and mvc, both files has the same parameters.

So I need to update zend-framework to be compatible with php7.2, not sure how to do it correctly, I used apt install composer.

When I further to install zend-framework using: composer require zendframework/...

It says:

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].

When I further to install zend-framework using:

composer require zendframework/...

It says:

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.
3

3 Answers

0
votes

You have zend-test too that's why phpunit is in composer.json. And you need php-xml extension to run it. Extension is phpunit's recruitment. You can remove zend-test from composer.json file if you don't need it -which's you need it for testing-, or you can install extension.

Checkout this question to install extension.

0
votes

I had a similar problem but using Magento2 with php7.1, after installing php7.1-bcmatch and php7.1-xml the problem was solved.

Make sure you also have installed these extensions that are commonly used in zend framework: php7.1-mbstring php7.1-mcrypt php7.1-cli php7.1-json php7.1-curl

0
votes

Thanks, it worked after I apt-get purge php7.* and apt-get install php7.1 and other 4 modules with php7.1-xml

But couldn't find php view(files) by /users/xxx or /signup/xxx, I found the following, not sure where is the path, it has root under upload/public folder and upload/module folder which has the views, but how does it find it?

 'users' => array(
                'type'    => 'segment',
                'options' => array(
                        'route'    =>  '/users[/[:action[/[:param1[/]]]]]',
                        'defaults' => array(
                                'controller' => 
 'DashboardManager\Controller\Signup',
                                'action'     => 'account',
                        ),
                ),
        ),
        'signup' => array(
                'type'    => 'segment',
                'options' => array(
                        'route'    =>  '/signup[/[:action[/[:param1[/]]]]]',
                        'constraints' => array(
                                'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'param1'     => '[0-9]+',
                        ),
                        'defaults' => array(
                                '__NAMESPACE__' => 'DashboardManager\Controller',
                                'controller' => 'DashboardManager\Controller\Signup',
                                'action'     => 'index',
                        ),
                ),
        ),
...

Is there any log file?

Thanks!