Strange behavior on stopping php artisan serve

523 views laravel

When i change my sql server from pgsql (localhost) to mysql (remote host) in the env file

database.php file has this line:

'default' => env('DB_CONNECTION', 'mysql'),

i run:

php artisan serve

and i call my page it does not respond and get stuck

After this i press CTRL+C and close laravel.

Then i restart the engine php artisan serve and then i get this error:

Laravel development server started: [Sun Sep 16 16:05:52 2018] Failed to listen on (reason: Address already in use)

Is there something I am missing.

If i go back to my local host database of pgsql and dont change the line

'default' => env('DB_CONNECTION', 'mysql'),

in my database.php file it works fine. (it should not because I am using a pgsql database)

I also tried using

php artisan serve --port 3333

but that has given the same behavior.

answered question

make sure other laravel app is not running on

2 Answers


Maybe another laravel application is running in this 8000 port. If not, you change the port for this application. like:

php artisan serve --port=8080

posted this

This happens when there is already an app running on You can close that app then it will work. OR if you want to run multple apps then use shown below way:


php artisan serve --host= --port=8888

You can try different host ip as well as port no.s

I suggest you should learn how to make a virtualhost

posted this

Have an answer?


Please login first before posting an answer.