2

10 minute ago I tried to connect with phppgadmin 5.1 but i found this error message on web server error log : " Misc has a deprecated constructor in /usr/share/phppgadmin/classes/Misc.php on line 8"

Phppgadmin is out of work.

I use php 7.0.

Someone knows how to fix it?

Thanks so much.

M.B.
  • 21
  • 1
  • 3

3 Answers3

3

In my own research, in PHP 7, PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated, and will be removed in the future. PHP 7 will emit E_DEPRECATED if a PHP 4 constructor is the only constructor defined within a class. Classes that implement a __construct() method are unaffected.

So my fix is open Misc.php, and locate the class Misc, in it there is a function called Misc, rename the function name with anything except for Misc because it will produce that error you've mentioned.

ItamarG3
  • 4,092
  • 6
  • 31
  • 44
Jee Poy
  • 31
  • 2
1

I found the same problem.Just browse and find Misc.php file it is located in classes folder inside your phpPgAdmin folder.Then,open it and search for Misc function and change it to anything except MIsc.In my case i changed it to Misc1.enter image description here

yogiwinardhana
  • 33
  • 1
  • 11
1

The easiest way to solve is to locate the Misc.php file in phppgadmin/classes/ and search for the the constructor function.You can see the class name is Misc and the constructor is also Misc.

This (notice) message is based on changes to PHP 7,So an old way of using a constructor is still in use, is what that message means.

What is expected is instead of having a class with a constructor like this:

<?php
  class Misc{
      function Misc() {
          echo 'I am the constructor';
      }
  }
?>

would now be expected to look like this:

<?php
   class Misc{
       function __construct() {
           echo 'I am the constructor';
       }
   }
?>

See the first section section of this PHP 7 deprecation info.

You can just comment out the old method and change it to the new method.It should work fine.

/* Constructor line : 15*/
Function __construct() {
}
Tithira
  • 634
  • 9
  • 22