[英]Xampp localhost Strict Standards error
即使我更改了php.ini文件。 我将php.ini更改为默认值:
; display_startup_errors
; Default Value: Off
; Development Value: On
; Production Value: Off
; error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
我将它们更改为:
display_startup_errors
Default Value: Off
Development Value: On
Production Value: Off
error_reporting
Default Value: E_ALL & ~E_NOTICE
Development Value: E_ALL | E_STRICT
Production Value: E_ALL & ~E_DEPRECATED
我仍然不断收到以下错误:
Strict Standards: Declaration of CUser::Save() should be compatible with that of CBase::Save() in D:\xampp\htdocs\web\newpacific\include\user.class.php on line 128
Strict Standards: Declaration of CUser::Add() should be compatible with that of CBase::Add() in D:\xampp\htdocs\web\newpacific\include\user.class.php on line 128
Strict Standards: Declaration of CUser::Edit() should be compatible with that of CBase::Edit() in D:\xampp\htdocs\web\newpacific\include\user.class.php on line 128
Strict Standards: Declaration of CNewsLetter::Save() should be compatible with that of CBase::Save() in D:\xampp\htdocs\web\newpacific\include\newsletter.class.php on line 89
Strict Standards: Declaration of CNewsLetter::Add() should be compatible with that of CBase::Add() in D:\xampp\htdocs\web\newpacific\include\newsletter.class.php on line 89
Strict Standards: Declaration of CNewsLetter::Edit() should be compatible with that of CBase::Edit() in D:\xampp\htdocs\web\newpacific\include\newsletter.class.php on line 89
Strict Standards: Declaration of CLanguage::UpdateSEO() should be compatible with that of CBase::UpdateSEO() in D:\xampp\htdocs\web\newpacific\include\language.class.php on line 186
Strict Standards: Declaration of CNav::Save() should be compatible with that of CBase::Save() in D:\xampp\htdocs\web\newpacific\include\nav.class.php on line 178
Strict Standards: Declaration of CNav::Edit() should be compatible with that of CBase::Edit() in D:\xampp\htdocs\web\newpacific\include\nav.class.php on line 178
Strict Standards: Declaration of CDatabase::GetAll() should be compatible with that of CBase::GetAll() in D:\xampp\htdocs\web\newpacific\include\database.class.php on line 119
Strict Standards: Declaration of CNews::GetMaxOrder() should be compatible with that of CBase::GetMaxOrder() in D:\xampp\htdocs\web\newpacific\include\news.class.php on line 160
Strict Standards: Declaration of CNews::UpdateOrder() should be compatible with that of CBase::UpdateOrder() in D:\xampp\htdocs\web\newpacific\include\news.class.php on line 160
Strict Standards: Declaration of CNavigation::GetMaxOrder() should be compatible with that of CBase::GetMaxOrder() in D:\xampp\htdocs\web\newpacific\include\navigation.class.php on line 75
Strict Standards: Declaration of CNavigation::UpdateOrder() should be compatible with that of CBase::UpdateOrder() in D:\xampp\htdocs\web\newpacific\include\navigation.class.php on line 75
Strict Standards: Declaration of CArticle::GetMaxOrder() should be compatible with that of CBase::GetMaxOrder() in D:\xampp\htdocs\web\newpacific\include\article.class.php on line 117
提前致谢。 我在论坛上搜索。 没弄清楚为什么仍然出现严格的标准错误
在xampp上进行了测试(没有它,所以只想看看),并在php.ini中设置“ error_reporting = E_ALL & ~E_DEPRECATED
”摆脱了严格的警告。 请记住重新启动服务器(并注释掉未注释的行),以使其生效。
另外,您还可以确保功能也符合标准。 我在网上找到的东西:
class ParentClass
{
protected static function foo($param1, $param2)
{
echo "Parent\n";
}
}
class ChildClass extends ParentClass
{
public static function foo($param1)
{
parent::foo($param1, 2);
echo "Child\n";
}
}
ChildClass::foo(1);
这会触发一个标准,因为foo与另一个foo不匹配,但是您可以简单地输入:
public static function foo($param1, $param2=2)
{
parent::foo($param1, 2);
echo "Child\n";
}
并使用$ param2或忽略它来摆脱警告,但是如果采取的话,我会使用它...
@craniumonempty我将php.ini重命名为其他名称,然后将php.ini-development文件重命名为php.ini现在不再出错。 希望这可以帮助某人
或者将error_reporting更改为error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.