1

I have a working installation with CakePHP 3.0.13. I'd like to upgrade to 3.8 before trying to jump to the 4.x branch. I've launched this: composer require cakephp/cakephp:3.8.12 and I get the next results:

./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
    - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
    - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
    - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
    - Installation request for cakephp/migrations 1.3.2 -> satisfiable by cakephp/migrations[1.3.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

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

It seems there is a dependency problem with the migrations package: Cake requires an upgrade on Migrations, but Migrations requires that cake remains in 3.0.*. In vendor/cakephp/migrations/composer.json I have:

    ...
    "require": {
        "php": ">=5.4",
        "robmorgan/phinx": ">=0.4.2 <0.5.0",
        "cakephp/cakephp": "3.0.*"
    },
    ...

I've tried also to upgrade Migrations using composer, but I get the opposite problem: cakephp should be upgraded, so I'm stuck. Any suggestions? Thx in advance!

pperejon
  • 443
  • 5
  • 19
  • 1
    Upgrade all dependencies at once, not one by one. Delete the `vendor` folder and the `composer.lock` file if there are still issues, even when all dependencies should be compatible. – ndm Jun 03 '20 at 08:52
  • I've removed `vendor/*` and `composer.lock`. Then I've edited `composer.json` with `"cakephp/cakephp": "3.8.12",` and launched `composer install`. I have the same result (apart from others about PHP version): `-Installation request for cakephp/migrations 1.3.2 -> satisfiable by cakephp/migrations[1.3.2]. - - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.` – pperejon Jun 03 '20 at 10:46
  • 2
    As mentioned, upgrade _all_ dependencies at once, require the compatible versions for CakePHP, for Migrations, and for whatever else dependencies you have in your application's `composer.json`. – ndm Jun 03 '20 at 11:35
  • 1
    Can you share **your own** `composer.json`? Whatever another package requires might not be that relevant – Nico Haase Jun 03 '20 at 11:47

1 Answers1

1

I think I've found the problem. As @ndm and @Nico-haase pointed I've reviewed my composer.json file. Between other packages I had: ... "cakephp/cakephp": "~3.0.13", "cakephp/migrations": "1.3.2", ... ...when I tried to upgrade CakePHP to 3.8.12, I should also have upgraded Migrations, 'cause migrations 1.3.2 runs in cake 3.0.13, not 3.8. That's why it didn't work. Now I've used 3.8.12 for Cake and simply @stable for migrations.

... "cakephp/cakephp": "~3.8.12", "cakephp/migrations": "@stable", ...

After upgrading also the platform requirements (php versions, libs, ...), I've launched composer install successfully. Thx a lot!!

pperejon
  • 443
  • 5
  • 19