OiO.lk Blog PHP Laravel: error when trying to start up server
PHP

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 artisan config/cache/view:clear
  • update composer
  • update windows

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..



You need to sign in to view this answers

Exit mobile version