Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sergionader's avatar

Server Keeps Restarting

Hello!

I have the same project in two Macbooks and both computers were running it well until recently. Both are running BigSur.

A few weeks ago, one of the notebooks (spec is below) started showing a totally weird behavior.

  1. start the server
  2. go the url, say, 127.0.0.1:8000
  3. and a new server is started on the console on port 8001.
  4. If we try to visit ...:8001, a new one will be started on port 8002 and so forth.

This image illustrates what happens: https://drive.google.com/file/d/1JKxLIRFN0jtTXq1fDPhG_5aZfNhYL3AY/view?usp=sharing

The project uses Laravel 6.20.16

Here is the spec:

MacBook Pro (15-inch, 2018)
Processor 2.9 GHz 6-Core Intel Core i9
macOS Big Sur 11.5.1
Memory 32 GB 2400 MHz DDR4

Any ideas?

Thanks!!!

Sergio

0 likes
7 replies
Snapey's avatar

if I had to guess i would say you have something in your app that calls artisan serve

sergionader's avatar

Thanks. I'll see if I find something. What is intriguing is that the same project runs on the other machine. Anyway, I'll check it.

Regards!

sergionader's avatar

Update and a question.

Update:

  1. I could not find anything that would call artisan serve inside the cade. 2, Then I copied the faulty project to another computer as was able to reproduce it
php artisan serve
Laravel development server started: http://127.0.0.1:8000
[Tue Aug 24 09:28:55 2021] PHP 7.4.16 Development Server (http://127.0.0.1:8000) started
[Tue Aug 24 09:29:00 2021] 127.0.0.1:52221 Accepted
Laravel development server started: http://127.0.0.1:8001
[Tue Aug 24 09:29:04 2021] PHP 7.4.16 Development Server (http://127.0.0.1:8001) started
[Tue Aug 24 09:29:51 2021] 127.0.0.1:52337 Accepted
Laravel development server started: http://127.0.0.1:8002
[Tue Aug 24 09:29:52 2021] PHP 7.4.16 Development Server (http://127.0.0.1:8002) started

How can I trace/log everything that happens after I type php artisan server?

Thanks!

siangboon's avatar

perhaps i would try to disable all the route, and write a simple callback function to return "hello world" for "/". if still happened there may something wrong with the core system/config.... perhaps can check the services provider as well...

if running well... then start tracing from the controller where your code triggered....

1 like
sergionader's avatar

Thanks, siangboon!

I'll try it and will keep this post updated!

sergionader's avatar

Update: I deleted the vendor folder and replaced the .env file with the one of the instance that was working and now everything works.

Thanks everyone!

duncan_'s avatar

Mostly this error is seen when the db connection is either not set or started.

Please or to participate in this conversation.