Why command “php artisan serve” not working

前端 未结 8 1870
醉梦人生
醉梦人生 2020-12-25 08:15

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. <

相关标签:
8条回答
  • 2020-12-25 08:30

    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

    0 讨论(0)
  • 2020-12-25 08:32

    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

    0 讨论(0)
  • 2020-12-25 08:32

    I think you also check your path which you use in the composer like C:\Users\HP> example:if your parent folder is blog then use C:\Users\HP> cd blog/ C:\Users\HP>blog> php artisan serve

    0 讨论(0)
  • 2020-12-25 08:33

    try

    php -S localhost:8000 -t public/
    

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

    0 讨论(0)
  • 2020-12-25 08:36

    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

    0 讨论(0)
  • 2020-12-25 08:43

    try only this

    php -S localhost:8000
    
    0 讨论(0)
提交回复
热议问题