Depreciation notice error in phpmyadmin with 16.04 (Nginix)

Ok if you want to get rid of those nasty notices you have basically 4 options.You should note that the notices are caused by the oldish version of PHPMyAdmin that still uses some deprecated code, mainly old constructor definition statements. But they don’t affect PHPMyAdmin as those statements still function but they should be changes as they will not work for eternity.

The fist one(recommended)

So the first one is to just turn off the notices for the PHPMyAdmin folder. You can do that by using the following commands:

cd /usr/share/phpmyadmin
sudo touch .user.ini
echo "error_reporting = 0" | sudo tee -a .user.ini
sudo service nginx restart

Second One

You could change error_reporting in php.ini, but there are many reasons you wouldn’t want that.

Third One

Use a different source repo for PHPMyAdmin, again I think there are many reasons one would want to stick with default PHPMyAdmin source repo. You can do this with the following commands:

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

Last one

You could change the files that generate the notices. Again I would not recommend this as this issue will probably be fixed later by Ubuntu. Anyway here are the changes you should do in this case:

sudo nano /usr/share/php/php-gettext/gettext.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) {

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) {
Share the joy

Leave a Reply