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

shakti's avatar

Doubt in running php artisan route:list

hello guys

I m facing a problem whenever i call php artisan route:list it give me error [ErrorException] Undefined index: REQUEST_URI

I know its occuring due to $_SERVER['REQUEST_URI'] but i have added this code in whole project so can we have any alternate solution for this so that i can get route list

0 likes
3 replies
Snapey's avatar

you need to review the use of this. Did you know that this and other server variables are available through the Request object?

anyway, that aside, you have a problem with your use of this because artisan commands boot the framework and DO NOT create a request_uri because artisan is not a http request

I think if you switch to Request you will have better luck

shakti's avatar

@snapey as i told in my question also i know why its occurring

Anyway i got it it won't work i was glad you reply thanks alot

Please or to participate in this conversation.