CodeIgniter Forums
How do I update from 4.4.4 to 4.5.5? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: How do I update from 4.4.4 to 4.5.5? (/showthread.php?tid=91784)



How do I update from 4.4.4 to 4.5.5? - occitan - 10-09-2024

I tried following the instructions here:
https://codeigniter.com/user_guide/installation/installing_composer.html#app-starter-upgrading
and added this to my root composer.json: "codeigniter4/framework": "4.5.5" (under require)
but I get the error: 
Root package 'codeigniter4/framework' cannot require itself in its composer.json 
Did you accidentally name your root package after an external package?

How do I upgrade correctly?


RE: How do I update from 4.4.4 to 4.5.5? - InsiteFX - 10-09-2024

You need to start with your version and incrementally upgrade using the Change Logs.

I looked, and yes you will also need to upgrade files in the app folders also.

Just do it step by step and upgrade each version.


RE: How do I update from 4.4.4 to 4.5.5? - kenjis - 10-10-2024

Read and follow the instructions.
Upgrading from 4.5.4 to 4.5.5
Upgrading from 4.5.3 to 4.5.4
Upgrading from 4.5.2 to 4.5.3
Upgrading from 4.5.1 to 4.5.2
Upgrading from 4.5.0 to 4.5.1
Upgrading from 4.4.8 to 4.5.0
Upgrading from 4.4.7 to 4.4.8
Upgrading from 4.4.6 to 4.4.7
Upgrading from 4.4.5 to 4.4.6
Upgrading from 4.4.4 to 4.4.5
https://codeigniter.com/user_guide/installation/upgrading.html


RE: How do I update from 4.4.4 to 4.5.5? - captain-sensible - 10-10-2024

can you post your composer.json file please this is mine:

Code:
{
    "name": "codeigniter4/appstarter",
    "description": "CodeIgniter4 starter app",
    "license": "MIT",
    "type": "project",
    "homepage": "https://codeigniter.com",
    "support": {
        "forum": "https://forum.codeigniter.com/",
        "source": "https://github.com/codeigniter4/CodeIgniter4",
        "slack": "https://codeigniterchat.slack.com"
    },
    "require": {
        "php": "^8.1",
        "codeigniter4/framework": "4.5.5",
         "phpmailer/phpmailer": "^6.8"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9",
        "mikey179/vfsstream": "^1.6",
        "phpunit/phpunit": "^10.5.16"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Config\\": "app/Config/"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\Support\\": "tests/_support"
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "scripts": {
        "test": "phpunit"
    }
}



so you edit this line :
Code:
"codeigniter4/framework": "4.5.5",
and change it incremently , so yours would be :
Code:
"codeigniter4/framework": "4.4.5",

then run from a cli run composer
command and output from mine :

Code:
[andrew@darkstar CI4-CMS]$ composer upgrade
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading phpmailer/phpmailer (v6.9.1 => v6.9.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading phpmailer/phpmailer (v6.9.2)
  - Upgrading phpmailer/phpmailer (v6.9.1 => v6.9.2): Extracting archive
Generating optimized autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.



RE: How do I update from 4.4.4 to 4.5.5? - opiecomp - 11-10-2024

Did you ever find a solution to this issue?  I'm having the exact same issue.  Everything upgrades successfully to 4.5.3.  But as soon as I try to upgrade to 4.5.4, its like the following doesn't belong in composer.json anymore...

   
Code:
"require": {
        "php": "^8.1",
        "codeigniter4/framework": "4.5.3",
        "ext-intl": "*",
        "ext-mbstring": "*",
        "laminas/laminas-escaper": "^2.13",
        "psr/log": "^3.0",
        "ramsey/uuid": "^4.1",
        "sonata-project/google-authenticator": "^2.3",
        "slim/slim": "3.*"
    },


I have it in the "require" section.  Just like https://codeigniter.com/user_guide/installation/installing_composer.html#app-starter-upgrading indicates it should be.  But when I do that I get the following errors:

-----------------------------------------------
$ composer update

In RootPackageLoader.php line 150:
                                                                                   
  Root package 'codeigniter4/framework' cannot require itself in its composer.json 
  Did you accidentally name your root package after an external package?           
                                                                                   

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]


RE: How do I update from 4.4.4 to 4.5.5? - kenjis - 11-30-2024

@opiecomp It seems your composer.json is broken.
If you show all the content of the file, someone may help you.


RE: How do I update from 4.4.4 to 4.5.5? - nahaK - 12-12-2024

Hello Everyone,
I'm trying to upgrade from 4.4.4 to 4.5.5 and facing the 'Root package cannot require itself' error in composer.json. Could anyone guide me on fixing this and the correct steps for upgrading?
Regards,
Anup.


RE: How do I update from 4.4.4 to 4.5.5? - captain-sensible - 12-12-2024

@nahaK post your composer file mine looks like :

Code:
{
    "name": "codeigniter4/appstarter",
    "description": "CodeIgniter4 starter app",
    "license": "MIT",
    "type": "project",
    "homepage": "https://codeigniter.com",
    "support": {
        "forum": "https://forum.codeigniter.com/",
        "source": "https://github.com/codeigniter4/CodeIgniter4",
        "slack": "https://codeigniterchat.slack.com"
    },
    "require": {
        "php": "^8.1",
        "codeigniter4/framework": "4.5.5",
        "phpmailer/phpmailer": "^6.8"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9",
        "mikey179/vfsstream": "^1.6",
        "phpunit/phpunit": "^10.5.16"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Config\\": "app/Config/"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\Support\\": "tests/_support"
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "scripts": {
        "test": "phpunit"
    }
}

last time i made the mistake of copying over the one from vendor/codeigniter4/framework it didnt go so well


RE: How do I update from 4.4.4 to 4.5.5? - nahaK - 12-13-2024

Thankyou.


RE: How do I update from 4.4.4 to 4.5.5? - opiecomp - 12-29-2024

My composer.json file matched what was in the framework directory and was mentioned in that update that caused me to update all, but my additions.
What I realized today, is that when I specify that I want to update to a specific "codeigniter4/framework" in the require section, that CANNOT be the "name" for the overall file.  As was posed previously, it used to be "codeigniter4/appstarter".  For some reason this changed with this update to now be "codeigniter4/framework"...which then led to the error seen.
If you're seeing this, change the "name" at the top of the composer.json file and it will clear it up for you.  This obviously wasn't tested...