php-server icon indicating copy to clipboard operation
php-server copied to clipboard

Is there a way to keep the server alive?

Open solemone opened this issue 3 years ago • 3 comments

Hi @sindresorhus,

thanks for the package! We have one problem. Maybe you can help us.

The server seems the be paused from time to time. Is there an option or another way to keep the server alive until I close the terminal?

System: macOS 11.6, Node v14.17.3, npm 6.14.13

Every support is welcome!

solemone avatar Apr 26 '22 16:04 solemone

I need a solution for the same problem, after few minutes the server closes without alert

@solemone or @sindresorhus found a method to solve it?

csouza1995 avatar Jun 04 '22 16:06 csouza1995

I had a similar issue and after a lot of debugging finally got it working by clearing the stdout and stderr streams

start().then((server) => {
      // Clearing the buffer to prevent the server from hanging
      server.stdout.on('data', () => {})
      server.stderr.on('data', () => {})
    })

Hannoma avatar Aug 24 '23 15:08 Hannoma