mezzio / mezzio-skeleton

Laminas mezzio skeleton. Begin developing PSR-15 middleware applications in seconds!
https://docs.mezzio.dev/mezzio/
BSD 3-Clause "New" or "Revised" License
120 stars 31 forks source link

Skeleton Installation Fails in PHP 8.0 #47

Closed dbierer closed 3 years ago

dbierer commented 3 years ago

Bug Report

Installation fails when running under PHP 8.0. Works OK when --ignore-platform-req option is added.

Q A
Composer 2.1-dev
Composer 1.10.22
PHP 8.0.0
Ubuntu 20.04

Summary

When running create project on Linux and PHP 8.0, I choose all Laminas components (e.g. option 3) and also Whoops. The installation then stops and I get a series of Composer version conflict messages for components I did not choose. Not sure if the problem is that the installer ignores my choices and installs other versions (e.g. other DI containers, other routers, other template engines), or if there's another PHP 8 conflict in one of the dependent composer.json::require directives.

Works OK when using the following syntax:

composer create-project --ignore-platform-req php mezzio/mezzio-skeleton /path/to/xyz

Current behavior

Here is the output from just now:

Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - Root composer.json requires php ^7.3 but your php version (8.0.0) does not satisfy that requirement.
  Problem 2
    - elie29/zend-phpdi-config is locked to version v6.0.1 and an update of this package was not requested.
    - elie29/zend-phpdi-config v6.0.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 3
    - jsoumelidis/zend-sf-di-config is locked to version 0.4.1 and an update of this package was not requested.
    - jsoumelidis/zend-sf-di-config 0.4.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 4
    - laminas/laminas-pimple-config is locked to version 1.1.2 and an update of this package was not requested.
    - laminas/laminas-pimple-config 1.1.2 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 5
    - mezzio/mezzio-tooling is locked to version 1.3.1 and an update of this package was not requested.
    - mezzio/mezzio-tooling 1.3.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 6
    - mezzio/mezzio-twigrenderer is locked to version 2.6.1 and an update of this package was not requested.
    - mezzio/mezzio-twigrenderer 2.6.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.

How to reproduce

Use any version of Linux running PHP 8.0 (I've tried it on 3 different versions of Linux):

cd /tmp
wget https://getcomposer.org/composer.phar
php composer.phar create-project mezzio/mezzio-skeleton mezzio

Expected behavior

Expected behavior is a completed Mezzio skeleton app.

Blackvz commented 3 years ago

I have the same problem. :/

dbierer commented 3 years ago

If you add the --ignore-platform-req flag, the installation proceeds OK. The problem has to do with minimum requirements in the dependent Composer packages. It appears that the installer installs all alternates (e.g. Aura DI, Twig, etc.) even if not selected. I had to manually edit the /config/config.php file and comment out the unwanted providers. Once I did that, and used the option to ignore platform requirements everything went OK.

michalbundyra commented 3 years ago

It is solved now - actually since 3.9.0 release.

Thanks for reporting.