【问题标题】:How to fix the PHP new version script error?如何修复 PHP 新版本脚本错误?
【发布时间】:2018-10-19 08:12:08
【问题描述】:

我最近将我的 PHPlinkdirectory 的 PHP 版本更新为最新版本,但更新后我开始出现以下错误。我立即将新版本更改为旧版本,但错误仍然存​​在。

PHP 在 5.4 版上运行。

Strict Standards: Only variables should be assigned by reference in /home/domain/public_html/init.php on line 275

Strict Standards: Non-static method SmartyPaginate::connect() should not be called statically in /home/domain/public_html/index.php on line 688

Strict Standards: Non-static method SmartyPaginate::getTotal() should not be called statically in /home/domain/public_html/libs/smarty/SmartyPaginate.class.php on line 51

Strict Standards: Non-static method SmartyPaginate::getUrlVar() should not be called statically in /home/domain/public_html/libs/smarty/SmartyPaginate.class.php on line 52

Strict Standards: Non-static method SmartyPaginate::disconnect() should not be called statically in /home/domain/public_html/index.php on line 693

Strict Standards: Non-static method SmartyPaginate::reset() should not be called statically in /home/domain/public_html/index.php on line 694

Strict Standards: Non-static method SmartyPaginate::setPrevText() should not be called statically in /home/domain/public_html/index.php on line 696

Strict Standards: Non-static method SmartyPaginate::setNextText() should not be called statically in /home/domain/public_html/index.php on line 697

【问题讨论】:

标签: php


【解决方案1】:

我认为这与 PHP 版本无关。您正在调用一个普通函数,就像它是静态的,但它不是。

你可以尝试进入这里:

public static function connect() {

}

或者你可以这样调用函数:

$paginate = new SmartyPaginate;
$paginate->connect();
$paginate->getTotal();

【讨论】:

  • 您可以使用:: 调用非静态方法,例如(parent::method) - 问题可能在其他地方.. 没有看到代码很难确定
猜你喜欢
  • 2023-03-31
  • 1970-01-01
  • 2014-04-02
  • 1970-01-01
  • 1970-01-01
  • 2023-01-09
  • 1970-01-01
  • 2012-12-19
  • 2012-06-05
相关资源
最近更新 更多