yiisoft / yii2-app-basic

Yii 2.0 Basic Application Template
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
656 stars 787 forks source link

Upgrading docker-compose with PHP 7.2 #237

Closed Gildus closed 3 years ago

Gildus commented 3 years ago

What steps will reproduce the problem?

composer install Return:

Problem 1
    - Installation request for doctrine/lexer 1.1.0 -> satisfiable by doctrine/lexer[1.1.0].
    - doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
  Problem 2
    - doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
    - egulias/email-validator 2.1.11 requires doctrine/lexer ^1.0.1 -> satisfiable by doctrine/lexer[1.1.0].

What's expected?

The all directory generated vendor with the packages like this:

# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
    1/35:   https://codeload.github.com/myclabs/DeepCopy/legacy.zip/007c053ae6f31bba39dfa19a7726f56e9763bbea
    2/35:   https://codeload.github.com/phpspec/prophecy/legacy.zip/f6811d96d97bdf400077a0cc100ae56aa32b9203
    3/35:   https://codeload.github.com/guzzle/psr7/legacy.zip/239400de7a173fe9901b9ac7c06497751f00727a
    4/35:   https://codeload.github.com/phpDocumentor/ReflectionDocBlock/legacy.zip/b83ff7cfcfee7827e1e78b637a5904fe6a96698e
    5/35:   https://codeload.github.com/webmozart/assert/legacy.zip/88e6d84706d09a236046d686bbea96f07b3a34f4
    6/35:   https://codeload.github.com/symfony/polyfill-php73/legacy.zip/2ceb49eaccb9352bff54d22570276bb75ba4a188
    7/35:   https://codeload.github.com/doctrine/instantiator/legacy.zip/a2c590166b2133a4633738648b6b064edae0814a
    8/35:   https://codeload.github.com/opis/closure/legacy.zip/e79f851749c3caa836d7ccc01ede5828feb762c7
    9/35:   https://codeload.github.com/phpspec/php-diff/legacy.zip/0464787bfa7cd13576c5a1e318709768798bec6a
    10/35:  https://codeload.github.com/phpDocumentor/ReflectionCommon/legacy.zip/63a995caa1ca9e5590304cd845c15ad6d482a62a
    11/35:  https://codeload.github.com/yiisoft/yii2-gii/legacy.zip/cf3e81953a9e9796eed4021f3065bc5c18ee3356
    12/35:  https://codeload.github.com/symfony/event-dispatcher-contracts/legacy.zip/c43ab685673fb6c8d84220c77897b1d6cdbe1d18
    13/35:  https://codeload.github.com/symfony/service-contracts/legacy.zip/ffcde9615dc5bb4825b9f6aed07716f1f57faae0
    14/35:  https://codeload.github.com/symfony/browser-kit/legacy.zip/61d85c5af2fc058014c7c89504c3944e73a086f0
    15/35:  https://codeload.github.com/yiisoft/yii2-debug/legacy.zip/4f1a9f0fe8c565203b9243613b0a81a46dde27e7
    16/35:  https://codeload.github.com/fzaninotto/Faker/legacy.zip/f72816b43e74063c8b10357394b6bba8cb1c10de
    17/35:  https://codeload.github.com/symfony/console/legacy.zip/929ddf360d401b958f611d44e726094ab46a7369
    18/35:  https://codeload.github.com/symfony/event-dispatcher/legacy.zip/6229f58993e5a157f6096fc7145c0717d0be8807
    19/35:  https://codeload.github.com/symfony/css-selector/legacy.zip/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9
    20/35:  https://codeload.github.com/symfony/polyfill-intl-idn/legacy.zip/6af626ae6fa37d396dc90a399c0ff08e5cfc45b2
    21/35:  https://codeload.github.com/symfony/dom-crawler/legacy.zip/e9f7b4d19d69b133bd638eeddcdc757723b4211f
    22/35:  https://codeload.github.com/symfony/polyfill-ctype/legacy.zip/550ebaac289296ce228a706d0867afc34687e3f4
    23/35:  https://codeload.github.com/symfony/finder/legacy.zip/5e575faa95548d0586f6bedaeabec259714e44d1
    24/35:  https://codeload.github.com/symfony/yaml/legacy.zip/41e16350a2a1c7383c4735aa2f9fce74cf3d1178
    25/35:  https://codeload.github.com/yiisoft/yii2-swiftmailer/legacy.zip/09659a55959f9e64b8178d842b64a9ffae42b994
    26/35:  https://codeload.github.com/swiftmailer/swiftmailer/legacy.zip/5397cd05b0a0f7937c47b0adcb4c60e5ab936b6a
    27/35:  https://codeload.github.com/yiisoft/yii2-composer/legacy.zip/5c7ca9836cf80b34db265332a7f2f8438eb469b9
    28/35:  https://codeload.github.com/symfony/polyfill-php72/legacy.zip/04ce3335667451138df4307d6a9b61565560199e
    29/35:  https://codeload.github.com/doctrine/lexer/legacy.zip/e17f069ede36f7534b95adec71910ed1b49c74ea
    30/35:  https://codeload.github.com/symfony/polyfill-mbstring/legacy.zip/b42a2f66e8f1b15ccf25652c3424265923eb4f17
    31/35:  https://codeload.github.com/egulias/EmailValidator/legacy.zip/92dd169c32f6f55ba570c309d83f5209cefb5e23
    32/35:  https://codeload.github.com/jquery/jquery-dist/legacy.zip/15bc73803f76bc53b654b9fdbbbc096f56d7c03d
    33/35:  https://codeload.github.com/symfony/polyfill-iconv/legacy.zip/685968b11e61a347c18bf25db32effa478be610f
    34/35:  https://codeload.github.com/ezyang/htmlpurifier/legacy.zip/83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7
    35/35:  https://codeload.github.com/yiisoft/yii2-framework/legacy.zip/f972275551172a4b2e293979d77aa0c795ae36a2
    Finished: success: 35, skipped: 0, failure: 0, total: 35
Package operations: 72 installs, 0 updates, 0 removals
  - Installing yiisoft/yii2-composer (2.0.8): Loading from cache
  - Installing bower-asset/jquery (3.4.1): Loading from cache
  - Installing bower-asset/inputmask (3.3.11): Loading from cache
  - Installing bower-asset/punycode (v1.3.2): Loading from cache
  - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
  - Installing cebe/markdown (1.2.1): Loading from cache
  - Installing doctrine/lexer (1.1.0): Loading from cache
  - Installing egulias/email-validator (2.1.11): Loading from cache
  - Installing ezyang/htmlpurifier (v4.11.0): Loading from cache
  - Installing symfony/polyfill-iconv (v1.12.0): Loading from cache
  - Installing symfony/polyfill-php72 (v1.12.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.12.0): Loading from cache
  - Installing symfony/polyfill-intl-idn (v1.12.0): Loading from cache
  - Installing yiisoft/yii2 (2.0.29): Loading from cache
  - Installing bower-asset/bootstrap (v3.4.1): Loading from cache
  - Installing yiisoft/yii2-bootstrap (2.0.10): Loading from cache
  - Installing swiftmailer/swiftmailer (v6.2.1): Loading from cache
  - Installing yiisoft/yii2-swiftmailer (2.1.2): Loading from cache
  - Installing symfony/polyfill-ctype (v1.12.0): Loading from cache
  - Installing symfony/yaml (v4.3.5): Loading from cache
  - Installing symfony/finder (v4.3.5): Loading from cache
  - Installing symfony/event-dispatcher-contracts (v1.1.7): Loading from cache
  - Installing symfony/event-dispatcher (v4.3.5): Loading from cache
  - Installing symfony/dom-crawler (v4.3.5): Loading from cache
  - Installing symfony/css-selector (v4.3.5): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/service-contracts (v1.1.7): Loading from cache
  - Installing symfony/polyfill-php73 (v1.12.0): Loading from cache
  - Installing symfony/console (v4.3.5): Loading from cache
  - Installing symfony/browser-kit (v4.2.4): Loading from cache
  - Installing sebastian/diff (2.0.1): Loading from cache
  - Installing sebastian/recursion-context (3.0.0): Loading from cache
  - Installing sebastian/exporter (3.1.2): Loading from cache
  - Installing sebastian/comparator (2.1.3): Loading from cache
  - Installing sebastian/version (2.0.1): Loading from cache
  - Installing sebastian/resource-operations (1.0.0): Loading from cache
  - Installing sebastian/object-reflector (1.1.1): Loading from cache
  - Installing sebastian/object-enumerator (3.0.3): Loading from cache
  - Installing sebastian/global-state (2.0.0): Loading from cache
  - Installing sebastian/environment (3.1.0): Loading from cache
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing doctrine/instantiator (1.2.0): Loading from cache
  - Installing phpunit/phpunit-mock-objects (5.0.10): Loading from cache
  - Installing phpunit/php-timer (1.0.9): Loading from cache
  - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
  - Installing theseer/tokenizer (1.1.3): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
  - Installing phpunit/php-token-stream (2.0.2): Loading from cache
  - Installing phpunit/php-code-coverage (5.3.2): Loading from cache
  - Installing webmozart/assert (1.5.0): Loading from cache
  - Installing phpdocumentor/reflection-common (2.0.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.0.1): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.2): Loading from cache
  - Installing phpspec/prophecy (1.9.0): Loading from cache
  - Installing phar-io/version (1.0.1): Loading from cache
  - Installing phar-io/manifest (1.0.1): Loading from cache
  - Installing myclabs/deep-copy (1.9.3): Loading from cache
  - Installing phpunit/phpunit (6.5.14): Loading from cache
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing codeception/stub (1.0.4): Loading from cache
  - Installing behat/gherkin (v4.4.5): Loading from cache
  - Installing codeception/base (2.3.9): Loading from cache
  - Installing codeception/specify (0.4.6): Loading from cache
  - Installing codeception/verify (0.4.0): Loading from cache
  - Installing opis/closure (3.4.1): Loading from cache
  - Installing yiisoft/yii2-debug (2.1.10): Loading from cache
  - Installing fzaninotto/faker (v1.8.0): Loading from cache
  - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
  - Installing phpspec/php-diff (v1.1.0): Loading from cache
  - Installing yiisoft/yii2-gii (2.1.2): Loading from cache
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
symfony/event-dispatcher-contracts suggests installing psr/event-dispatcher
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/event-dispatcher suggests installing symfony/http-kernel
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing psr/log (For using the console logger)
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
symfony/browser-kit suggests installing symfony/process
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
codeception/base suggests installing aws/aws-sdk-php (For using AWS Auth in REST module and Queue module)
codeception/base suggests installing codeception/phpbuiltinserver (Start and stop PHP built-in web server for your tests)
codeception/base suggests installing flow/jsonpath (For using JSONPath in REST module)
codeception/base suggests installing league/factory-muffin (For DataFactory module)
codeception/base suggests installing league/factory-muffin-faker (For Faker support in DataFactory module)
codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module)
codeception/base suggests installing stecman/symfony-console-completion (For BASH autocompletion)
codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
> yii\composer\Installer::postInstall

What do you get instead?

Use the image yiisoftware/yii2-php:7.2-apache like minimal requirement in docker-compose.yml

Additional info

Q A
Yii vesion 2.0.29
PHP version 7.1
Operating system Debian GNU/Linux 10 (Buster)
schmunk42 commented 3 years ago

The error comes from a 7.1 version, but the image is 7.2?!

> docker run -it  yiisoftware/yii2-php:7.2-apache php -v
usermod: no changes
PHP 7.2.34 (cli) (built: Oct 13 2020 11:32:15) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34, Copyright (c) 1999-2018, by Zend Technologies

Besides that I can run composer install and update on this repo.


[addon]

Please check if you have mixed up the versions, eg. composer update on 7.2 and install on 7.1 - that would explain the error.

bizley commented 3 years ago

Yes, I have fetched this project and run the image, did the composer install with default dev minimum stability and with stable one. Everything works. It looks like this error is because of your custom dependencies so you need to fix this on your side (including upgrading your PHP if needed).

Gildus commented 3 years ago

I’m sorry but do you see or check the file docker-compose.yml ?

https://github.com/yiisoft/yii2-app-basic/blob/b50d3e1dfe73985fb84b54a61a18eb74bb60b1fa/docker-compose.yml#L4

bizley commented 3 years ago

Yes, it's a part of the project so you are free to change it however you want, like for example placing there yiisoftware/yii2-php:7.2-apache (which I can see is available at docker hub).

samdark commented 3 years ago

We can change it in the template.

samdark commented 3 years ago

Done.

bizley commented 3 years ago

I'm sorry but in this case why not upgrade it to 7.4?

samdark commented 3 years ago

He-he :) Yes, that would be even better.

samdark commented 3 years ago

Done https://github.com/yiisoft/yii2-app-basic/commit/f95f012873b7965d40a5fcf91fafff2db661c7a1