phpmyadmin中的折旧通知错误,16.04

我在16.04启动phpmyadmin时遇到错误。

以下是错误:

Deprecation Notice in ./../php/php-gettext/streams.php#48 Backtrace ./../php/php-gettext/gettext.inc#41: require() ./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc) ./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php) ./index.php#12: require_once(./libraries/common.inc.php) it continues with these as well with the same backtrace as above: Deprecation Notice in ./../php/php-gettext/streams.php#84 Deprecation Notice in ./../php/php-gettext/streams.php#145 Deprecation Notice in ./../php/php-gettext/gettext.php#36 

我已经更新并validation了我的最新gettext和mbstring。 任何关于解决的想法

这取决于你是否有足够的冒险精神。 如果你理解错误,那就意味着你的PHP有一些旧的类构造函数。

OLD Php类构造函数

 Class myclassname { function myclassname() { //This is a constructor } 

新的Php类构造函数

 Class myclassname { function __construct() { //this is the new constructor using __construct instead of the same function name as class name. } 

所以我做的是进入/usr/share/php/php-gettext/stream.php/usr/share/php/php-gettext/gettext.php (或错误中陈述的任何文件),转到文件和更改function myclassname()function __construct

函数myclassname应与CLASS myclassname声明相同。

如果您使用最新的gettext在ubuntu 16.04上,您应该会看到大约4个错误。 我只是改变它,它对你的系统没有害处。 这是一种过时的编程语法,如果你将来升级,你也不会遇到任何问题。 我会说这是一个安全的编辑。

这不是一个重大的改变或任何事情,只是语法更新。 如果从apt-get软件包安装,除非你自己编译,否则你别无选择。

 sudo nano /usr/share/php/php-gettext/streams.php 

第48行StringReader错误。

转到第52行并进行更改

 function StringReader ($str='') { 

 function __construct($str='') { 

第84行FileReader错误

转到第90行并进行更改

 function FileReader($filename) { 

 function __construct($filename) { 

第145行CacheFileReader错误

转到第146行并进行更改

 function CachedFileReader($filename) { 

 function __construct($filename) { 

使用sudo nano /usr/share/php/php-gettext/gettext.php

第36行gettext_reader {错误

我认为你现在得到了要点,转到第101行并改变

 function gettext_reader($Reader, $enable_cache = true) { 

 function __construct($Reader, $enable_cache = true) { 

您可以使用另一个PPA用于phpmyadmin。这是PPA链接

 sudo add-apt-repository ppa:nijel/phpmyadmin sudo apt update sudo apt install phpmyadmin 

因为它只是一个临时解决方案或不是最佳解决方案,直到ubuntu repos中的phpmyadmin包重建。

由于我还没有足够的声誉来评论Someone Special的最佳答案,我只会回复。

以下是执行建议编辑的单行命令:

  sed -ri.bak的:function StringReader。*:function __construct($ str = \ x27 \ x27){:'/ usr / share / php / php_gettext / streams.php
 sed -ri的:function FileReader。*:function __construct($ filename){:'/ usr / share / php / php_gettext / streams.php
 sed -ri的:function CachedFileReader。*:function __construct($ filename){:'/ usr / share / php / php_gettext / streams.php
 sed -ri.bak的:function gettext_reader。*:function __construct($ Reader,$ enable_cache = true){:'/ usr / share / php / php_gettext / gettext.php

通过编辑/etc/php/7.0/apache2/php.ini的php.ini文件,可以轻松解决这个弃用通知“phpMyAdmin登录页面上的消息”

将error_reporting值更改为:

 error_reporting = ~E_DEPRECATED & E_ALL 

默认情况下,它位于注释位置,因此取消注释并更改它。

然后重启Apache:

 sudo systemctl restart apache2