CodeIgniter Forums
404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: - 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: 404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: (/showthread.php?tid=78059)



404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: - damia - 11-25-2020

Hello, I'm still new with Codeigniter 4 here.



I tried to load my localhost on browser but it give me this error below (image attached)













404 - File Not Found

Controller or its method is not found: \App\Controllers\Home::index












can anyone please help me on why is this happening?


RE: 404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: - wdeda - 11-25-2020

You should check if in App\Controllers there is the file Home.php, exactly like this, starting with a capital letter.
This refers to Controller in the error message.

If the file exists, in its content there must be a definition of the method, as below:
class Home extends BaseController. (the first run is how it looks)
Home, is the method referred to in the error message.

I am curious to know how you installed the framework: unzipping the file, e.g., framework 4.0.4.zip or via composer. In both ways, if the server settings are correct, the image sent by you looks like they are, the home page is displayed without problems, unless, of course, you have altered something.


RE: 404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: - sammyskills - 11-25-2020

Hi @damia,

Have you been able to resolve the issue?

Perhaps you could check out this link to give you an insight on 404 errors in CI.

Cheers


RE: 404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: - damia - 12-01-2020

(11-25-2020, 04:31 AM)wdeda Wrote: You should check if in App\Controllers there is the file Home.php, exactly like this, starting with a capital letter.
This refers to Controller in the error message.

If the file exists, in its content there must be a definition of the method, as below:
class Home extends BaseController. (the first run is how it looks)
Home, is the method referred to in the error message.

I am curious to know how you installed the framework: unzipping the file, e.g., framework 4.0.4.zip or via composer. In both ways, if the server settings are correct, the image sent by you looks like they are, the home page is displayed without problems, unless, of course, you have altered something.
 Thank you so much!


RE: 404 - File Not Found Controller or its method is not found: \App\Controllers\Home:: - damia - 12-01-2020

(11-25-2020, 09:43 AM)sammyskills Wrote: Hi @damia,

Have you been able to resolve the issue?

Perhaps you could check out this link to give you an insight on 404 errors in CI.

Cheers
Thank you so much!