我想用“php spark serve”为Codeigniter-4启动一个本地服务器,但是得到这些错误

oyjwcjzk  于 2022-12-07  发布在  PHP
关注(0)|答案(1)|浏览(249)
PS C:\xampp\htdocs\dashboard-db> php spark serve
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to CodeIgniter\HTTP\URI::setScheme() must be of the type string, null given, called in C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php on line 443 and defined in C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\URI.php:749
Stack trace:
#0 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php(443): CodeIgniter\HTTP\URI->setScheme(NULL)
#1 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php(207): CodeIgniter\HTTP\IncomingRequest->setPath('', Object(Config\App))
#2 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php(169): CodeIgniter\HTTP\IncomingRequest->detectURI('REQUEST_URI', ' http://localho...')
#3 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\Config\Services.php(589): CodeIgniter\HTTP\IncomingRequest->__construct(Object(Config\App), Object(CodeIgniter\HTTP\URI), '', Objec in C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\URI.php on line 749

Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniter\HTTP\URI::setScheme() must be of the type string, null given, called in C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php on line 443 and defined in C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\URI.php:749
Stack trace:
#0 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php(443): CodeIgniter\HTTP\URI->setScheme(NULL)
#1 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php(207): CodeIgniter\HTTP\IncomingRequest->setPath('', Object(Config\App))
#2 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\IncomingRequest.php(169): CodeIgniter\HTTP\IncomingRequest->detectURI('REQUEST_URI', ' http://localho...')
#3 C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\Config\Services.php(589): CodeIgniter\HTTP\IncomingRequest->__construct(Object(Config\App), Object(CodeIgniter\HTTP\URI), '', Objec in C:\xampp\htdocs\dashboard-db\vendor\codeigniter4\framework\system\HTTP\URI.php on line 749
efzxgjgh

efzxgjgh1#

很抱歉我回答得太晚了。你可能已经解决了这个问题,但这个观察结果也可能对其他人有所帮助。
此问题可能是由.env文件中的app.base URL引起的。键入“localhost”或“localhost:8080”等URL将不正确,应尝试键入“http://localhost”。

相关问题