Why command “php artisan serve” not working

2020-02-23 05:21发布

问题:

I started Laravel at this path:

C:\Users\Mad\Work\trunk\product\backend\v1.2.1\laravel

but it is not working, it is not starting.

Please give me suggestions how I will do it ?

回答1:

try

php -S localhost:8000 -t public/

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



回答2:

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



回答3:

Try this also

php -S 127.0.0.1:8000 -t public/

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



回答4:

try only this

php -S localhost:8000


回答5:

Your missing some Server Requirements

See the Laravel site for requirements. Laravel Documentation
The Laravel framework has a few system requirements.

If you are not using Homestead, you will need to make sure your server meets the following requirements:

PHP >= 7.1.3
BCMath PHP Extension
Ctype PHP Extension
JSON PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PDO PHP Extension
Tokenizer PHP Extension
XML PHP Extension

To see a list of your extensions... From the command line:
$ php -m

I was missing BCMath and Tokenizer so I installed them with:
$ sudo apt-get install php-bcmath
$ sudo apt-get install php-tokenizer

Now you can use $ php artisan serve