我正在使用 xampp 1.7.0,但决定升级到 xampp 1.8.1。我卸载了1.7,但没有卸载htdocs和mysql服务器。
我现在安装了1.8并通过xampp安全页面为xampp目录和mysql创建密码。
不幸的是,我无法再次查看我的网站,它们都给出错误,这是一个示例错误:
Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\import.php on line 29
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\3nity\libraries\loader.php on line 71
Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\import.php on line 32
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\3nity\libraries\loader.php on line 71
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\3nity\libraries\loader.php on line 138
Strict Standards: Non-static method JRequest::clean() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\import.php on line 33
Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\environment\request.php on line 463
请问我该怎么办,因为我没有所有网站的备份,现在手头有一个当前客户项目,我已经努力工作了 5 年了。
我使用的是win 7操作系统64位,使用的是xampp-win32-1.8.1-VC9-installer。
最佳答案
这可能是由于最新 XAMPP 中的 PHP 版本不同(较新)造成的。 PHP 5.4(确切地说是 PHP 5.4.7)对于错误代码的警告更加严格。
真正的问题在于实际的 PHP 代码(无论是您的代码还是包中使用的代码,例如 Joomla)。
如果它来自您的代码,您应该修复它。通过以静态方式访问静态方法属性或属性(例如 class Foo { public static $bar = 123; }
和 Foo::$bar
来访问它) ,以及 class Bar { public static function foo() { } }
和 Bar::foo()
来调用它。注意我们如何使用 ::
而不是 ->
。这意味着没有事件的实例化状态。换句话说,$bar = new Bar(); $bar->foo();
是不正确的,因为它将它作为实例方法调用,而不是通过 Bar::foo()
静态调用。
同样,如果问题相反,则开发人员可能必须将方法声明为静态
(如果该方法是无状态且静态调用的)。
对于 Joomla 案例,似乎已经有各种相关报道:
- http://forum.joomla.org/viewtopic.php?t=271244
- http://www.apachefriends.org/f/viewtopic.php?p=182516
- http://www.apachefriends.org/f/viewtopic.php?p=166802
(通过在Google中粘贴错误发现!)
详细了解状态和静态之间的区别:
- http://php.net/manual/en/language.oop5.static.php
- http://phpduck.com/php-static-methods-and-properties/ (已存档)
如果您只有警告(没有错误),请了解 error_reporting
并禁用这些无害的警告(通过降低错误报告级别)。这样您就可以减少噪音并专注于其他事情。
在开发过程中,您可能不应该隐藏任何警告,以便您可以发现它们并改进您的代码。但在生产中,隐藏警告并仅记录错误可能会更好。
关于joomla - 升级到 Xampp 1.8.1 后,无法查看我的网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13245449/