Framework: php artisan serve can't bind to any port

Created on 9 Sep 2020  路  6Comments  路  Source: laravel/framework

  • Laravel Version: 8.0.1
  • PHP Version: 7.4.10
  • OS: Windows 10
  • Database Driver & Version: no database needed

Description:

After upgrading to laravel 8, and running the command php artisan serve, it responds with an error recursively, like so:

image

This behavior does not happen if i change php version to 7.4.5 or switch to laravel 7.x.

Steps To Reproduce:

  1. have a laravel project started up with version 8.x
  2. make sure you have the most recent stable php version installed (at time of writing 7.4.10)
  3. run php artisan serve
  4. see that the command can't bind itself to any port

As additional note, i debugged the generated command (running php artisan serve), and copy paste it directly in the command line and it worked, without returning any error.

If you need any more info, just ask.

Thanks

Most helpful comment

The one line I needed to change in my php.ini to fix this problem was
variables_order = "EGPCS"
to
variables_order = "GPCS"

All 6 comments

We don't use windows ourselves so feel free to send in a PR which fixes this on Windows.

Can't reproduce this. Might be something on your machine interfering.

Hi, thanks for your feedback.

I managed to resolve this issue. Not quite sure what as the cause, but it was related with something not right in php.ini.

So what i did was use the standard php.ini-development (that comes with a pre built php), and add whats missing in the file and should work. In any doubt try only renaming php.ini-development to php.ini without modifying its contents.

The one line I needed to change in my php.ini to fix this problem was
variables_order = "EGPCS"
to
variables_order = "GPCS"

Something to do with the Env variable. No ideia how this affects the core functionality of php built in server to this degree.

Something to do with the Env variable. No ideia how this affects the core functionality of php built in server to this degree.

It's in the 8^ laravel upgrade. Because the server if one run it directly works fine:

php -S 127.0.0.1:8000  -t public/ server.php

and in Laravel 7 artisan serve works without problems (windows 10, php 7.4.6).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments

lzp819739483 picture lzp819739483  路  3Comments

YannPl picture YannPl  路  3Comments

Anahkiasen picture Anahkiasen  路  3Comments