0
votes

I tried to just load zend-authentication, while doing it I get an error:

require zendframework/zend-authentication Using version ^2.6 for zendframework/zend-authentication ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (5.6.31) does not satisfy that requirement. - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (5.6.31) does not satisfy that requirement. - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (5.6.31) does not satisfy that requirement. - Installation request for doctrine/instantiator (locked at 1.1.0) -> satisfiable by doctrine/instantiator[1.1.0].

Installation failed, reverting ./composer.json to its original content.

The error shows that the php-version might be wrong, but if I open my wamp startpage on localhost, it shows php version 7.1.9.

Why composer sees the wrong php version and how to fix it?

1

1 Answers

1
votes

When you run composer, you're running php-cli (command line interface), which in your case is a different version from the version apache (WAMP) uses.

What you need to do is go and change the PATH environment variable to target the PHP version you use in WAMP : http://www.forevolve.com/en/articles/2016/10/27/how-to-add-your-php-runtime-directory-to-your-windows-10-path-environment-variable/

Also, make sure composer uses the right version: http://webdevzoom.com/how-to-install-composer-on-windows/#changing-phppath