安裝新的 xampp 版本后出現此錯誤。并克隆我的 codeigniter 專案。
Message: Return type of CI_Session_files_driver::open($save_path, $name)
should either be compatible with SessionHandlerInterface::open(string $path, string $name):
bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
檔案名:drivers/Session_files_driver.php
行號:132
uj5u.com熱心網友回復:
對于遇到此錯誤的其他任何人,我在升級到 PHP 8.1 后也遇到了它。我能找到“修復”它的唯一方法是#[\ReturnTypeWillChange]在. 例如:openreadwriteclosedestroygc/system/libraries/Session/drivers/Session_files_driver.php
#[\ReturnTypeWillChange]
public function open($save_path, $name)
{
...
uj5u.com熱心網友回復:
我在重新安裝 XAMPP Server 后遇到了這個錯誤。我已經通過添加解決了這個問題
#[\ReturnTypeWillChange]
對于所有方法 ( open, read, write, close, destroy and gc) 中Session_files_driver.php file。該檔案可以在專案檔案夾中找到system/libaries/Session/drivers/Session_files_driver.php
#[\ReturnTypeWillChange]
public function open($save_path, $name)
{
...
}
#[\ReturnTypeWillChange]
public function read($session_id)
{
...
}
#[\ReturnTypeWillChange]
public function write($session_id, $session_data)
{
...
}
#[\ReturnTypeWillChange]
public function close()
{
...
}
#[\ReturnTypeWillChange]
public function destroy($session_id)
{
...
}
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/420105.html
標籤:
上一篇:Mssql錯誤:選擇串列中的列'dbo.History.Email'無效,因為它既不包含在聚合函式中,也不包含在GROUPBY子句中
