"Deprecation Notice" error in phpmyadmin with 16.04
This depends whether you are adventurous enough. If you understand the error, it means your PHP has some old class constructors.
OLD Php Class Constructor
Class myclassname {
function myclassname() {
//This is a constructor
}
New Php Class Constructor
Class myclassname {
function __construct() {
//this is the new constructor using __construct instead of the same function name as class name.
}
So what I did was to go into /usr/share/php/php-gettext/stream.php
and /usr/share/php/php-gettext/gettext.php
(or whatever file stated in your error), go to the file and change function myclassname()
to function __construct
.
The function myclassname
should be identical to the CLASS myclassname
declaration.
You should see about 4 errors if you are on ubuntu 16.04 with latest gettext. I just change that and it's not harmful to your system. It's a outdated programming syntax and if you upgrade in the future you wouldn't face any problem too. I will say it's a safe edit.
It's not really a major change or anything, just syntax updating. If you install from apt-get package you really have no other choice unless you compile yourself.
sudo nano /usr/share/php/php-gettext/streams.php
Line 48 StringReader Error.
Go to Line 52 and change
function StringReader ($str='') {
TO
function __construct($str='') {
Line 84 FileReader Error
Go to Line 90 and change
function FileReader($filename) {
to
function __construct($filename) {
Line 145 CacheFileReader error
Go to Line 146 and change
function CachedFileReader($filename) {
to
function __construct($filename) {
Using sudo nano /usr/share/php/php-gettext/gettext.php
.
Line 36 gettext_reader {
error
I think you get the gist now, go to line 101 and change
function gettext_reader($Reader, $enable_cache = true) {
To
function __construct($Reader, $enable_cache = true) {
Since I don't have enough reputation yet to comment on Someone Special's great answer, I'll just reply instead.
Here are the one-line commands that perform the suggested edits:
sed -ri.bak 's:function StringReader.*:function __construct($str=\x27\x27) {:' /usr/share/php/php-gettext/streams.php sed -ri 's:function FileReader.*:function __construct($filename) {:' /usr/share/php/php-gettext/streams.php sed -ri 's:function CachedFileReader.*:function __construct($filename) {:' /usr/share/php/php-gettext/streams.php sed -ri.bak 's:function gettext_reader.*:function __construct($Reader, $enable_cache = true) {:' /usr/share/php/php-gettext/gettext.php