Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tomas95go's avatar

Problems with the PHP Practitioner series Episode 16

Hi Everyone, I'm very happy that I'm learning PHP with such a good teacher like Jeffrey however im having problems with this Episode.

I keep getting the same error message:

Fatal error: Uncaught Exception: No route defined for this URI in D:\Xamp\htdocs\laracast-curso1\core\Router.php:35 Stack trace: #0 D:\Xamp\htdocs\laracast-curso1\index.php(8): Router->direct('laracast-curso1...') #1 {main} thrown in D:\Xamp\htdocs\laracast-curso1\core\Router.php on line 35

I already try the solutions that other user's metion in the comments of the episode, and I still can't fix this.

I'm using Xampp v3.2.2 on Windows.

0 likes
7 replies
ejdelmonico's avatar

@tomas95go The error message says your route is not defined properly or not at all. Index.php is looking in routes.php for the uri and can't find it so it throws the error.

tomas95go's avatar

@ejdelmonico Thanks for answer, yeah I know that, but that's the weird thing! the route is defined, I follow the instructions of the video step by step like I always do, that's why I don't know what's going on. I checked the solutions that people come up on the comments on the video but nothing it's working.

ejdelmonico's avatar

I do not use XAMP or any of those type products any longer, just VM's. But, it may be because of where the public directory is located. Laravel is set up so that the public directory is the root "web" directory and all others are one level up for security purposes. It could be that you need to have a close look at where your public directory is located. I am just thinking out loud why it is not working for you.

jrkdev's avatar

It's hard to tell without seeing all of the code. I guess you're not using Laravel yet if you're doing that course? What's on line 35 of your Router.php?

tomas95go's avatar

@eldelmonico @jasoking92 sorry for the late reply, when you 're talking about the directory of the code, is in the right carpet (htdocs on XAMPP), i'm not using Laravel, this is pure php.

How can I upload the code so you can take a look at it? cause Router.php uses other codes to execute.

jollyjaywhiskers's avatar

@tomas95go did you ended up figuring this out? I'm stuck on this exact problem. It seems to work fine if I hardcode the URI, but as soon as I use the var $uri it seems to break.

tonyfwin's avatar

Did anyone ever end up figuring this out? I'm having the same issue of having to hardcore the URI to get routes working correctly. I copied the code exactly from the github repo that's below episode 16 and my environment is the free version of scotchbox.

Please or to participate in this conversation.