Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back to PHP 7.4 for Magento versions older than 2.4.4 #685

Closed
florinel-chis opened this issue Apr 19, 2022 · 9 comments
Closed

Fall back to PHP 7.4 for Magento versions older than 2.4.4 #685

florinel-chis opened this issue Apr 19, 2022 · 9 comments
Assignees
Labels

Comments

@florinel-chis
Copy link

Description

Steps To Reproduce

  1. Run:
    curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.3.4

Expected Result
I get a docker setup with Magento 2.3.4

Actual Result

Creating network "m243_default" with the default driver
Creating volume "m243_appdata" with default driver
Creating volume "m243_dbdata" with default driver
Creating volume "m243_rabbitmqdata" with default driver
Creating volume "m243_sockdata" with default driver
Creating volume "m243_ssldata" with default driver
Creating m243_rabbitmq_1      ... done
Creating m243_elasticsearch_1 ... done
Creating m243_mailcatcher_1   ... done
Creating m243_redis_1         ... done
Creating m243_phpfpm_1        ... done
Creating m243_app_1           ... done
Creating m243_db_1            ... done
Composer auth has already been set up.
Creating a "magento/project-community-edition=2.3.4" project at "./"
Installing magento/project-community-edition (2.3.4)
  - Downloading magento/project-community-edition (2.3.4)
  - Installing magento/project-community-edition (2.3.4): Extracting archive
Created project in /var/www/html/.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires magento/product-community-edition 2.3.4 -> satisfiable by magento/product-community-edition[2.3.4].
    - magento/product-community-edition 2.3.4 requires php ~7.1.3||~7.2.0||~7.3.0 -> your php version (8.1.4) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
    - dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires php ^5.3|^7 -> your php version (8.1.4) does not satisfy that requirement.
  Problem 3
    - Root composer.json requires magento/magento2-functional-testing-framework 2.5.3 -> satisfiable by magento/magento2-functional-testing-framework[2.5.3].
    - magento/magento2-functional-testing-framework 2.5.3 requires php 7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0 -> your php version (8.1.4) does not satisfy that requirement.
  Problem 4
    - phpunit/phpunit[6.5.0, ..., 6.5.14] require php ^7.0 -> your php version (8.1.4) does not satisfy that requirement.
    - Root composer.json requires phpunit/phpunit ~6.5.0 -> satisfiable by phpunit/phpunit[6.5.0, ..., 6.5.14].

@dirkreitz
Copy link

you are sure you want to setup Magento version 2.3.4 ?? This would only work with a php version which isn't supported anymore.

brgds. Dirk

@florinel-chis
Copy link
Author

you are sure you want to setup Magento version 2.3.4 ?? This would only work with a php version which isn't supported anymore.

brgds. Dirk

yes, I am sure about what I want. Limitations should be clearly described (like we will support only Magento 2.4.4 or whatever and php 8.1).
In theory this setup worked in the past (at some point in time Magento 2.3.4 was the latest version available/and supported).

@dirkreitz
Copy link

in Changelog you could have read, that php v7.3 image was removed because EOL (41.1.0). If you are stuck on the Magento 2.3.x branch, try v2.3.7 but I would go with php v7.4 ...

brgds. Dirk

@dirkreitz
Copy link

Maybe Mark could introduce a switch for the docker-compose file to revert back to php7.4

@markshust
Copy link
Owner

I'm definitely not supporting 7.3 anymore as that has reached EOL -- no one should be running that version because of security issues.

I'd rather not revert the default to 7.4, as 8.1 is really the new standard moving forward, and I think those expecting to install Magento today would expect it to run on 8.1. That said, I still support 7.4, and if someone tries to install a version less than 2.4.4, it really should default back to the latest 7.4 image rather than 8.1.

I'd be open to taking in any PRs if someone wants to add in this fallback capability! I can do this, but I may not get to it for a little bit.

@markshust
Copy link
Owner

FYI I think the logic would best to implement in the bin/download file, after bin/stop is executed at https://github.com/markshust/docker-magento/blob/master/compose/bin/download#L6, which is before the docker images are started up again.

We have access to the VERSION variable at that time, and it's before the initial Docker images are started up (& pulled/downloaded for new installs if they don't already exist). Can probably use something like sed to find/replace the 8.1-fpm-0 tag with 7.4-fpm-14 in the docker-compose.yml file.

@markshust markshust self-assigned this Apr 20, 2022
@markshust
Copy link
Owner

I got this :)

@markshust markshust changed the title Magento 2.3.4 dependencies issue Fall back to PHP 7.4 for Magento versions older than 2.4.4 Apr 20, 2022
markshust added a commit that referenced this issue Apr 20, 2022
@markshust
Copy link
Owner

All fixed! If you now try to request a version of Magento before 2.4.4, it should update the docker-compose.yml file to the PHP 7.4 image. We'll need a better method of pulling in the latest PHP 7.4/8.1 image tag if/when these are ever updated, but I'll do my best to remember the to update this with new tags until then.

@dirkreitz
Copy link

nice work, Mark !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants