如何修复Joomla的错误(Strict Standards: Non-static method JLoader::import() should not be called statically)

2018年6月12日06:54:06 发表评论 488 阅读

今天打开网站,发现以下错误信息。

1、网页错误信息情况

Strict Standards: Non-static method JLoader::import() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/import.php on line 29 Strict Standards: Non-static method JLoader::register() should not be called statically in /home/wwwroot/codeback.net/libraries/loader.php on line 71 Strict Standards: Non-static method JLoader::import() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/import.php on line 32 Strict Standards: Non-static method JLoader::register() should not be called statically in /home/wwwroot/codeback.net/libraries/loader.php on line 71 Strict Standards: Non-static method JLoader::load() should not be called statically in /home/wwwroot/codeback.net/libraries/loader.php on line 161 Strict Standards: Non-static method JLoader::register() should not be called statically in /home/wwwroot/codeback.net/libraries/loader.php on line 138 Strict Standards: Non-static method JRequest::clean() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/import.php on line 33 Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/environment/request.php on line 463 Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/environment/request.php on line 464 Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/environment/request.php on line 465 Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/environment/request.php on line 466 Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/environment/request.php on line 467 Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/environment/request.php on line 468 Strict Standards: Non-static method JLoader::import() should not be called statically in /home/wwwroot/codeback.net/libraries/joomla/import.php on line 35 Strict Standards: Non-static method JLoader::register() should not be called statically in

服务器从来没有出现这个问题,初步判断是PHP版本或者php.ini配置的问题。先检测php.ini。一下子忘记路径了。在网站目录中建一个  php文件,内容为

2、查找php.ini路径

<?phpinfo();?>

如何修复Joomla的错误(Strict Standards: Non-static method JLoader::import() should not be called statically)

php.ini的路径为:/usr/local/php/etc/php.ini

3、编辑php.in  /usr/local/php/etc/php.ini

vi /usr/local/php/etc/php.ini

找到:

error_reporting = E_ALL | E_STRICT

4、注释error_reporting

并将其更改为:

;error_reporting = E_ALL | E_STRICT

;是注释的作用。

然后重启PHP一切OK。

总结

  1. Open php.ini file.
  2. Find “error_reporting = E_ALL | E_STRICT” (this would be around line number 516)
  3. Replace with “;error_reporting = E_ALL | E_STRICT“
  4. Restart the PHP and Nginx.

 

修复Joomla的错误,修复完成后发现其实就是php 版本的问题,屏蔽错误信息。

hcyaobin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: