当我运行laravel new blog
或任何名称时,出现以下错误:
Crafting application...
PHP Fatal error: Uncaught TypeException: Argument 2 passed to GuzzleHttpAdapterStreamAdapter::createResponseObject() must be of the type array, null given, called in C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php on line 67 and defined in C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php:71
Stack trace:
#0 C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php(67): GuzzleHttpAdapterStreamAdapter->createResponseObject(Object(GuzzleHttpMessageRequest), NULL, Object(GuzzleHttpAdapterTransaction), Object(GuzzleHttpStreamStream))
#1 C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php(52): GuzzleHttpAdapterStreamAdapter->createResponse(Object(GuzzleHttpAdapterTransaction))
#2 C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcClient.php(193): GuzzleHttpAdapterStreamAdapter->send(Object(GuzzleHttpAdapterTransaction)) #3 C:U in C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php on line 71
Fatal error: Uncaught TypeException: Argument 2 passed to GuzzleHttpAdapterStreamAdapter::createResponseObject() must be of the type array, null given, called in C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php on line 67 and defined in C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php:71
Stack trace:
#0 C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php(67): GuzzleHttpAdapterStreamAdapter->createResponseObject(Object(GuzzleHttpMessageRequest), NULL, Object(GuzzleHttpAdapterTransaction), Object(GuzzleHttpStreamStream))
#1 C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php(52): GuzzleHttpAdapterStreamAdapter->createResponse(Object(GuzzleHttpAdapterTransaction))
#2 C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcClient.php(193): GuzzleHttpAdapterStreamAdapter->send(Object(GuzzleHttpAdapterTransaction)) #3 C:U in C:UsersFelixAppDataRoamingComposervendorguzzlehttpguzzlesrcAdapterStreamAdapter.php on line 71
我不明白这是怎么发生的。这是我的PhpInfo文件
谢谢
答案很简单。我从 PHP7 而不是 XAMPP/PHP5 运行 PHP CLI。只需取消注释extension=php_curl.dll
行。