To solve the 404 error.. Follow the steps :- 1. Go to app folder 2. then go to config folder 3. then open Routes.php file 4. set ' $routes->setAutoRoute(true); ' Hope it's help❤
Please note everyone: This tutorial is not applicable for new version of codeigniter4. such as version 4.3.6. Lot of things have changed. You need to add every controller to route.php file in order to view the page in the browser. If you need an updated tutorial, I will create and upload for you. Please let me know in the comment reply section. Thank you
in latest ci4, it will show a 404 message when you run it. Simply add this line to your Routes.php Hope this help. $routes->get('welcome', 'Welcome::index');
@@aniketgautam7615 if you are working on composer intalled app... 1) rename the env file to .env and in that uncommemt "Environment= production" And change it to development 2) go to app/Config/Routes.php and do routing there... $routes->get('about', 'Home::about') ; ... for about view. Suggestion: start with CI4 documentation. Follow that until "newsapp" Is completed.
I can not load my codeigniter homepage or other controllers after setting controllers in app/controller folder. I received the following error after loading localhost. It was working the other days. ..................... Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster. Error 403 localhost Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.5
can you tell me, How you are loading your project in browser URL I mean are you loading like below localhost/project-folder/controller-name or are you using any URL format?
@@GoPHP It was working fine until yesterday. The page was loading everything was working I'm following ur videos. Even if I load using localhost alone to check the codeignetor msg it doesn't work or even if I use localhost/controller name or localhost/project foldername/ controller name. In all of this case the above error appears. But when I load xampp server and click on admin on apache server side the codeignitor welcome message appears.
@@soumyapratimbanerjee5878 bro help, it says 404 - Page Not Found Sorry! Cannot seem to find the page you were looking for. Im done doing this ($routes->get('welcome', 'Welcome::index'); or this ($routes->setAutoRoute(true);) nothings happens. pls help
that base controller extended in the home controller, already extends the "Controller" class. And the Home.php controller just extended the BaseController. This baseController is used for auto loading required helpers or libraries. It's not compulsory to create a BaseController and use that as an extension for other classes. You can directly extend "Controller" class. Still, you can create a BaseController in every SubFolder of Controller folder, and load necessary helpers or libraries.
example: 1) create a subFolder in App->Controllers. 2) create two php files a) BaseController.php b)ExampleController.php 3) Now you can extend CodeIgniter\Controller to BaseController class, like mentioned below: use CodeIgniter\Controller; class BaseController extends Controller{ #your code } 4) Then you can extend "BaseController" class to "ExampleController" class, like mentioned below: namespace App\Controllers; class ExampleController extends BaseController { #your code }
To solve the 404 error.. Follow the steps :-
1. Go to app folder
2. then go to config folder
3. then open Routes.php file
4. set ' $routes->setAutoRoute(true); '
Hope it's help❤
yes 👍👍👍👍
Thanks 👍
Thankssssssssssss❤
thank big help
Perfect Bro
Sir your method of teaching is just awesome. Thanks for this series :)
getting error 404 file not found : Can't find a route for 'get: /test'. test is controller name
Please note everyone: This tutorial is not applicable for new version of codeigniter4. such as version 4.3.6. Lot of things have changed. You need to add every controller to route.php file in order to view the page in the browser. If you need an updated tutorial, I will create and upload for you. Please let me know in the comment reply section. Thank you
Please teach us
You can teach us😊
I received following error---
404 - File Not Found
Can't find a route for 'get: welcome'. Can you help me?
in routes.php write
$routes->setAutoRoute(true);
after
$routes->set404Override();
@@ankitdavda1758 Thanks. Saved a Day.
@@ankitdavda1758 Thank you brother.
@@ankitdavda1758 you are a life saver!
While accessing Controller File it showing 404 file not found error Pls provide solution on it
Add a new route $routes->get('welcome', 'Welcome::index');
@@soumyapratimbanerjee5878thank you brother, I don't know why he didn't explain this in the video.
@@HimanshuSharma-bq8ol anytime bro😌
I'm getting an error. Can anyone help?
"404 - File Not Found
Sorry! Cannot seem to find the page you were looking for." 🤔
same issue
You explained very well.
when i pass argument in parameter $name its not work in my case
Just wondering how come BaseController may breaks the controller naming rule itself ?
in latest ci4, it will show a 404 message when you run it. Simply add this line to your Routes.php
Hope this help.
$routes->get('welcome', 'Welcome::index');
THANK YOU SO MUCH SIR, YOU ARE AWESOME...
not working
404 - file not found
Sorry! Cannot seem to find the page you were looking for.
Same problem bro
Did you find any new solution ? Please let me know
I got this error because i didn't set the route.
@@vipinpatel7604 ok
in routes.php write
$routes->setAutoRoute(true);
after
$routes->set404Override();
hello, sir when I do call the controller in the same process but not work through error 404.
Add a new route $routes->get('welcome', 'Welcome::index');
When i run this code i got an error, after defining path in route file my code works.
It is throwing error 404 - file not found. Please tell the solution.
same problem ..did you find any solution?
@@aniketgautam7615 if you are working on composer intalled app...
1) rename the env file to .env and in that uncommemt "Environment= production" And change it to development
2) go to app/Config/Routes.php and do routing there... $routes->get('about', 'Home::about') ; ... for about view.
Suggestion: start with CI4 documentation. Follow that until "newsapp" Is completed.
Brother You recommended myci4 which is having vendor. github folder too, and using mannual ci4 project Folder ?
We can use anyone
But recommended is composer installation
I can not load my codeigniter homepage or other controllers after setting controllers in app/controller folder. I received the following error after loading localhost. It was working the other days.
.....................
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.5
can you tell me, How you are loading your project in browser URL
I mean are you loading like below
localhost/project-folder/controller-name
or
are you using any URL format?
@@GoPHP It was working fine until yesterday. The page was loading everything was working I'm following ur videos. Even if I load using localhost alone to check the codeignetor msg it doesn't work or even if I use localhost/controller name or localhost/project foldername/ controller name. In all of this case the above error appears. But when I load xampp server and click on admin on apache server side the codeignitor welcome message appears.
bro where did you make all the changes . inside VENDER or in the root .
i am requesting for these slides so i can read through at my pace. otherwise thank you for this good work
docs.google.com/presentation/d/1Hwi1-Ays_n8iMfCOIQEhdQCk-7Co2bto/edit?usp=sharing&ouid=114060942945316235553&rtpof=true&sd=true
@@GoPHP THANK YOU SO MUCH
hii bro gud evening
1)
Add a new route $routes->get('welcome', 'Welcome::index');
@@soumyapratimbanerjee5878 bro help, it says 404 - Page Not Found Sorry! Cannot seem to find the page you were looking for. Im done doing this ($routes->get('welcome', 'Welcome::index'); or this ($routes->setAutoRoute(true);) nothings happens. pls help
7:00
good explained
bro why did you no extends by BaseController
that base controller extended in the home controller, already extends the "Controller" class. And the Home.php controller just extended the BaseController. This baseController is used for auto loading required helpers or libraries.
It's not compulsory to create a BaseController and use that as an extension for other classes. You can directly extend "Controller" class.
Still, you can create a BaseController in every SubFolder of Controller folder, and load necessary helpers or libraries.
example:
1) create a subFolder in App->Controllers.
2) create two php files a) BaseController.php b)ExampleController.php
3) Now you can extend CodeIgniter\Controller to BaseController class, like mentioned below:
use CodeIgniter\Controller;
class BaseController extends Controller{
#your code
}
4) Then you can extend "BaseController" class to "ExampleController" class, like mentioned below:
namespace App\Controllers;
class ExampleController extends BaseController
{
#your code
}
Thank you sir
can't render the php file using segment url. it shows the folder content. but it works when i click index.php how can i solve this?