我想用"php spark serve"启动 Codeigniter-4 的本地服务器,但收到这些错误


PS C:xampphtdocsdashboard-db> php spark serve
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to CodeIgniterHTTPURI::setScheme() must be of the type string, null given, called in C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php on line 443 and defined in C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPURI.php:749
Stack trace:
#0 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php(443): CodeIgniterHTTPURI->setScheme(NULL)
#1 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php(207): CodeIgniterHTTPIncomingRequest->setPath('', Object(ConfigApp))
#2 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php(169): CodeIgniterHTTPIncomingRequest->detectURI('REQUEST_URI', ' http://localho...')
#3 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemConfigServices.php(589): CodeIgniterHTTPIncomingRequest->__construct(Object(ConfigApp), Object(CodeIgniterHTTPURI), '', Objec in C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPURI.php on line 749

Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniterHTTPURI::setScheme() must be of the type string, null given, called in C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php on line 443 and defined in C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPURI.php:749
Stack trace:
#0 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php(443): CodeIgniterHTTPURI->setScheme(NULL)
#1 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php(207): CodeIgniterHTTPIncomingRequest->setPath('', Object(ConfigApp))
#2 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPIncomingRequest.php(169): CodeIgniterHTTPIncomingRequest->detectURI('REQUEST_URI', ' http://localho...')
#3 C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemConfigServices.php(589): CodeIgniterHTTPIncomingRequest->__construct(Object(ConfigApp), Object(CodeIgniterHTTPURI), '', Objec in C:xampphtdocsdashboard-dbvendorcodeigniter4frameworksystemHTTPURI.php on line 749

很抱歉回答晚了。你可能解决了这个问题,但这个观察可能也会帮助其他人。

问题可能是由.env文件中的app.base URL引起的。键入"localhost"或"localhost:8080"将是不正确的,您应该尝试键入"http://localhost"。

相关内容

  • 没有找到相关文章

最新更新