Arne Sneyers
Arne Sneyers

Reputation: 19

Laravel: error when trying to start up server

I installed composer, php and laravel via below code as found in the Laravel docs

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://php.new/install/windows'))

creation of a new app worked fine, when running "php artisan serve" the server starts, then throws below error and shuts itself down

 Undefined array key 1

  at vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php
:368
    364▕         $line = str_replace('  ', ' ', $line);
    365▕
    366▕         preg_match($regex, $line, $matches);
    367▕
  ➜ 368▕         return Carbon::createFromFormat('D M d H:i:s Y', $matches[1]);
    369▕     }
    370▕
    371▕     /**
    372▕      * Get the request port from the given PHP server output.

  1   vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.ph
p:368

I found similar threads, but none of the solutions worked.

PHP v 8.3.11 Composer v 2.8.1 Laravel v 11.9

I watched several tutorials all using xAMP, but I have worked with Laravel 9 in the passed and I don't believe that xAMP was used..

Upvotes: 0

Views: 85

Answers (1)

Herbert Tereski
Herbert Tereski

Reputation: 1

I couldn't solve it either, the only way I found to get around this for now was to install a previous version of laravel.

composer create-project laravel/laravel:^10.0 example-app

Upvotes: -1

Related Questions