Laravel — PHP Artisan Serve Failed

William Meier - Jun 14 - - Dev Community

Solve error “Failed to listen on 127.0.0.1:8000 (reason: ?)” when run “php artisan serve”

Resolution
Access your php.ini file in your PHP version folder. If you like me are using Laravel Herd on Windows you can access using the route "%USERPROFILE%.config\herd\bin".
Now in your php.ini change the "variables_order" value.

// before
variables_order = "EGPCS"

// after
variables_order = "GPCS"
Enter fullscreen mode Exit fullscreen mode

Alternative
If this don't work you can also start the server with PHP start command.

php -S localhost:8000 -t public
Enter fullscreen mode Exit fullscreen mode

That's it. I hope it will help you.

.