Why command "php artisan serve" not working

Solution 1:

try

php -S localhost:8000 -t public/

source : http://allbitsnbytes.com/posts/php-artisan-serve-not-working/

Solution 2:

Try this also

php -S 127.0.0.1:8000 -t public/

https://www.tutsmake.com/laravel-command-php-artisan-serve-not-working-properly/

Solution 3:

try to execute the command : composer update.
It will update and export all the directorys/files that u need.
because sometimes when u clone/download a repository from github .. there are pretty much directorys/files that are not present (not exportable .. present in .gitignor).
then try : php artisan serve. it works for me

Solution 4:

composer update

This will update and export directories and files and then run the below command :

php artisan serve

or you can also try this on your terminal:

php -S localhost:8000 -t public/

Solution 5:

Just wanted to add to Jayhuan's answer above:

Laravel does the same thing behind the scenes, you can see the code here (look in serverCommand).

So to serve locally you would do: php artisan serve --host mysite.com --port 8000