1

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.
edigu
  • 9,878
  • 5
  • 57
  • 80
Ann S.
  • 27
  • 6

3 Answers3

1

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

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.

  • I took zend-test out of composer.lock, and run composer require zendframework/zendframework again and I installed extension using apt-get for php-mbstring and php7.1-xml, still the same error. – Ann S. Feb 07 '18 at 20:14
  • Can u see xml extension when you type php -m on console? Also you have to reset apache after update php. – Mehmet SÖĞÜNMEZ Feb 08 '18 at 11:37
  • And my ubuntu updated php to 7.2 recently so please be sure your apache using 7.1 instead of 7.2. if it's using 7.2 so you have to install extension for 7.2 – Mehmet SÖĞÜNMEZ Feb 08 '18 at 11:38
  • Composer's error message shows you how to do at last line: php --ini – Mehmet SÖĞÜNMEZ Feb 12 '18 at 17:13
  • I'm connecting my server via ssh as root user. So when i run `composer update`, all file's owners switches to `root` and i've to run `chown -R user:user` to make them run. Otherwise apache doesn't run them 'cause web use doesn't have permission to run them. That can be your situation but i'm not sure. Seems like your server is ngix. – Mehmet SÖĞÜNMEZ Mar 15 '18 at 06:24
0

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!

Ann S.
  • 27
  • 6