Artisan Error: Failed to listen on localhost:8000

后端 未结 11 792
清酒与你
清酒与你 2021-01-30 08:58

I\'m having problem starting my laravel installation. Whenever I type in the terminal \'php artisan serve\' it responses me an error:

Fai

11条回答
  •  无人及你
    2021-01-30 09:19

    When php artisan serve command given, below mentioned problem occured.

    macridmi1109@Ridmis-MacBook-Pro kcnk % php artisan serve

    Laravel development server started on http://localhost:8000/

    [Thu Aug 6 11:31:10 2020] Failed to listen on localhost:8000 (reason: Address already in use)

    Then try this line of code,

    macridmi1109@Ridmis-MacBook-Pro project_laravel % ps -ef | grep php

    Result will be,

    501 66167 1 0 11:24am ttys002 0:00.77 /usr/bin/php -S localhost:8000 /Users/macridmi1109/Documents/Laravel/project_laravel/server.php

    501 66268 64261 0 11:31am ttys002 0:00.00 grep php

    Finally run the below code and, then again php artisan serve

    macridmi1109@Ridmis-MacBook-Pro project_laravel % kill 66167

    SOLUTION EXPLAINED BELOW

    I use the command, ps -ef | grep php. After that, you will be able to find Process ID. After recognising the correct Process ID, use this command kill 66167 (kill "Process ID"). Then try php artisan serve. This worked for me.

    Happy Coding

提交回复
热议问题