'Laravel failed to listen on 127.0.0.1:8000 (reason ?)
So I just created a new project using the command:
laravel new blog
Then I started by changing the directory and do the command
php artisan serve
And this is what happened, more details:
- I'm using laravel 8.0.1 (latest version)
- I haven't run any command except the one I listed above
- I'm using windows
- I even updated the php to 7.4.10 (latest ver)
Solution 1:[1]
So actually i dont actually know what the reason is, but using the php -S localhost:8000 -t public
Solution 2:[2]
I came across the same issue. This was how how I solved mine:
- Goto the main PHP part, I mean the installed PHP from official website.
- Look out for a folder named
php.ini-development
- Duplicate this file.
- Then rename the copy to
php.ini
- Go back to your laravel project folder and rerun
php artisan serve
PS: If there is any additional steps you took, you can as well comment them below: XOXO
Solution 3:[3]
Check your PHP version in your local server and System variable path. Make sure they are using the same PHP version
Solution 4:[4]
I had this problem too, and I solved it in this way:
set: php.ini
variables_order = "GPCS"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Mario Gunawan |
Solution 2 | Fritzdultimate |
Solution 3 | Azizjon Nigmatov |
Solution 4 | karel |