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

nbukhari's avatar

PHP Fatal error: Uncaught TypeError: Symfony\\Component\\HttpFoundation\\Request::createRequestFromFactory(): Argument #1 ($query) must be of type array, null given

I'm facing this error in laravel 9 project (recently upgraded from 8) I have upgraded it by manual respectively for all impact changes. it is throwing an error 500 and can not understand what does it need or where is the problem exactly I have tested it in two different environments such as xampp and wamp with different PHP versions.

PHP Fatal error: Uncaught TypeError: Symfony\Component\HttpFoundation\Request::createRequestFromFactory(): Argument #1 ($query) must be of type array, null given, called in C:\xampp\htdocs\vendor\symfony\http-foundation\Request.php on line 295 and defined in C:\xampp\htdocs\vendor\symfony\http-foundation\Request.php:1899\nStack trace:\n#0 C:\xampp\htdocs\vendor\symfony\http-foundation\Request.php(295): Symfony\Component\HttpFoundation\Request::createRequestFromFactory(NULL, NULL, Array, Array, Array, Array)\n#1 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Http\Request.php(75): Symfony\Component\HttpFoundation\Request::createFromGlobals()\n#2 C:\xampp\htdocs\public\index.php(67): Illuminate\Http\Request::capture()\n#3 {main}\n thrown in C:\xampp\htdocs\vendor\symfony\http-foundation\Request.php on line 1899

0 likes
6 replies
Niush's avatar

Was the composer update successful?

Also, try removing vendors directory and composer.lock file and re-install using composer install.

nbukhari's avatar

@Niush composer update works fine I deleted the vendor and package.lock and also no luck.

henrique_f's avatar

I had the same problem, in my case, it was because I forgot to create the .env file.

Please or to participate in this conversation.