Update from 4.6.0 to 4.6.1 failed |
I got in trouble with latest update...it's my fault for sure but each update it's a pain.
I run composer update to update new files...then I downloaded the latest package and manually replaced the following files in the project space: Code: app/Config/Autoload.php Now, when I try to run spark serve file I got the follwoing error: Code: PHP Warning: require(D:\_GAVS_nuovo_sito\project-root\app\Config/../../system/Boot.php): Failed to open stream: No such file or directory in D:\_GAVS_nuovo_sito\project-root\spark on line 85 Honestly I have no idea what I did wrong...any hint or help? Thanks a lot
05-11-2025, 08:57 AM
(This post was last modified: 05-11-2025, 12:58 PM by captain-sensible. Edit Reason: usual suspects )
the new Paths.php in app/Config/ looks like this for 4.6.1 ( at least on mine it does )
1) Code: class Paths but on another post i think there was consensus it should be : 2) Code: class Paths Code: /srv/http/CI4-CMS/vendor/codeigniter4/framework/system so edit /app/Config/Paths.php to code 2) above and see
This is one reason that I always make a backup of the whole project before modifying them.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Hi,
Yes, git is your friend! :-) You mixed up the Composer and the manual upgrade... When you download CI4, the system folder is a the same level as the app folder. And the file /app/Config/Paths.php know it. When you use the Composer appstart, the system folder is inside the vendor folder. And the file /app/Config/Paths.php also know it. What I do to upgrade is to use a composer update for the framework. Then I create a new project by doing a composer install appstarter and compare the project files and copy/merge the files that are different.. Hope this can help you.
Yesterday, 10:43 AM
(This post was last modified: Yesterday, 10:44 AM by captain-sensible. Edit Reason: usual suspects )
@FlavioSuar quote " You mixed up the Composer and the manual upgrade..." i started with app starter , and always have updated with composer. Never any manual install . yet my latest Paths.php at
Code: vendor/codeigniter4/framework/app looks like So my empirical observation and your comment its "confusing " from getting a path for a manual download but using composer, one might say its a bit of a dogs breakfast
@FlavioSuar 's suggestion is the best way to go, to be honest
@captain-sensible if you are looking at the contents of Paths.php inside vendor/codeigniter4/framework/app, it will always be the value "__DIR__ . '/../../system'" for the system directory. __DIR__ there means "vendor/codeigniter4/framework/app/Config" so doing a realpath() call on that will give "vendor/codeigniter4/framework/system" Now, when you just blindly copy that value to your Paths.php which is located at "./app/Config", __DIR__ would get that directory as its value, so realpath() on that copy pasted value is just "./system" which does not exists as the system folder is inside vendor and not on the root level.
@FlavioSuar quote " You mixed up the Composer and the manual upgrade..."
@captain-sensible sorry the confusion. This answer was to @Vespa... As he said "I run composer update to update new files...then I downloaded the latest package and manually replaced the following files in the project space: [...] app/Config/Paths.php" The system folder defined at app/Config/Paths.php is different if you do a composer install or manually download the zip file. In the downloaded zip file, app/Config/Paths.php points to a system folder at the same level of app, and there is no vendor folder. In the composer install, the same app/Config/Paths.php points to a system folder inside the vendor folder. Then if you copy the app/Config/Paths.php from the zip file over the composer install, you'll loose the correct path to system folder. |
Welcome Guest, Not a member yet? Register Sign In |