【发布时间】:2016-07-09 10:25:57
【问题描述】:
将 Plesk 和 PHP 升级到版本 7.0.8 后,我在使用 Smarty 时收到以下警告。
不推荐使用 PHP:与其类同名的方法在 PHP 的未来版本中将不再是构造函数; Smarty_Compiler 在第 35 行的 /var/www/vhosts/mydomain.com/httpdocs/Smarty/Smarty_Compiler.class.php 中有一个已弃用的构造函数
这里是警告中提到的文件:
/*
* @link http://smarty.php.net/
* @author Monte Ohrt <monte at ohrt dot com>
* @author Andrei Zmievski <andrei@php.net>
* @version 2.6.20
* @copyright 2001-2005 New Digital Group, Inc.
* @package Smarty
*/
/* $Id: Smarty_Compiler.class.php 2773 2008-08-12 18:17:51Z Uwe.Tews $ */
/**
* Template compiling class
* @package Smarty
*/
class Smarty_Compiler extends Smarty {
我需要帮助来了解问题以及如何解决它,它是相对于 Smarty 还是可以解决?
【问题讨论】:
-
分享更多信息请喜欢你现在的php版本是什么?并分享完整的错误信息。
-
AH01071: Got error 'PHP message: PHP Deprecated: Method with the same name as their class will not be constructors in the future version of PHP; Smarty_Compiler 在第 35 行的 /var/www/vhosts/mydomain.com/httpdocs/Smarty/Smarty_Compiler.class.php 中有一个已弃用的构造函数\n'
-
运行 PHP 7.0.8 版
-
我编辑了您问题的标题,以包含有关您的警告的更多信息,例如您刚刚更新到的 PHP 版本。我也在问题中添加了您在 cmets 中提供的所有新信息并改进了格式。祝你好运!