Welcome Guest, Not a member yet? Register   Sign In
Error after rename app direcory

Hello everyone.

After days of searching for a problem, I need your help!

I'm trying to rename the "app" directory to "myapp" but I get this error:

Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniter\CodeIgniter::__construct() must be an instance of Config\App, null given, called in C:\wamp64\www\CI4\vendor\codeigniter4\framework\system\Config\Services.php on line 139 and defined in C:\wamp64\www\CI4\vendor\codeigniter4\framework\system\CodeIgniter.php on line 147
I followed the Codeigniter documentation for the following changes.

In Config/Paths.php

PHP Code:
public $appDirectory __DIR__ '/..'
In public/index.php

PHP Code:
$pathsConfig FCPATH '../myapp/Config/Paths.php'

I did a CI 4 install with composer with this command line :

composer create-project codeigniter4/appstarter --no-dev
Here is my file structure

[Image: capture.png]

And I use Wampserver
Thanks in advance everyone!

(This post was last modified: 01-28-2022, 07:43 PM by kenjis.)

Why do you need to change? It is not so easy.

--- a/composer.json
+++ b/composer.json
@@ -18,8 +18,6 @@
    "autoload": {
        "psr-4": {
-            "App\\": "app",
-            "Config\\": "app/Config"
        "exclude-from-classmap": [

And run `composer dump-autoload`.

It will also mess up spark.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Theme © iAndrew 2016 - Forum software by © MyBB