Welcome Guest, Not a member yet? Register   Sign In
Update from 4.6.0 to 4.6.1 failed
#1

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

app/Config/Cache.php

app/Config/DocTypes.php

app/Config/Mimes.php

app/Config/Modules.php

app/Config/Optimize.php

app/Config/Paths.php

app/Views/errors/html/debug.css

preload.php

public/index.php

spark

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

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
PHP Fatal error:  Uncaught Error: Failed opening required 'D:\_GAVS_nuovo_sito\project-root\app\Config/../../system/Boot.php' (include_path='.;C:\php\pear') in D:\_GAVS_nuovo_sito\project-root\spark:85
Stack trace:
#0 {main}
  thrown in D:\_GAVS_nuovo_sito\project-root\spark on line 85

Fatal error: Uncaught Error: Failed opening required 'D:\_GAVS_nuovo_sito\project-root\app\Config/../../system/Boot.php' (include_path='.;C:\php\pear') in D:\_GAVS_nuovo_sito\project-root\spark:85
Stack trace:
#0 {main}
  thrown 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
Reply
#2

(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
{
    /**
    * ---------------------------------------------------------------
    * SYSTEM FOLDER NAME
    * ---------------------------------------------------------------
    *
    * This must contain the name of your "system" folder. Include
    * the path if the folder is not in the same directory as this file.
    */
    public string $systemDirectory = __DIR__ . '/../../system';

but on another post i think there was consensus it should be :


2)

Code:
class Paths
{
    /**
    * ---------------------------------------------------------------
    * SYSTEM FOLDER NAME
    * ---------------------------------------------------------------
    *
    * This must contain the name of your "system" folder. Include
    * the path if the folder is not in the same directory as this file.
    */
    public string $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system';
    /**
certainly the path to my system on apache for a web called CI4-CMS is 
Code:
/srv/http/CI4-CMS/vendor/codeigniter4/framework/system

so edit /app/Config/Paths.php to code 2) above and see
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#3

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 )
Reply
#4

too true, git is one way
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#5

(This post was last modified: Yesterday, 09:33 AM by FlavioSuar.)

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.
Reply
#6

(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

public string $systemDirectory = __DIR__ . '/../../system';

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
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#7

@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.
Reply
#8

(This post was last modified: 9 hours ago by FlavioSuar.)

@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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB