Windows 上的 PHPPGAdmin 给出了一个“虚拟类——无法实例化”错误

我在 Windows 10 上安装了 PHPPGAdmin。

Postgres 很好,我可以在命令行上登录。

但是当我尝试登录 PHPPGadmin Web UI 时出现以下错误:

Virtual Class -- cannot instantiate

这是我的 PHPPGAdmin 配置文件:

<?php  
    $conf['servers'][0]['desc'] = 'PostgreSQL';
    $conf['servers'][0]['host'] = 'localhost';
    $conf['servers'][0]['port'] = 5432;
    $conf['servers'][0]['sslmode'] = 'allow';
    $conf['servers'][0]['defaultdb'] = 'template1';
    $conf['servers'][0]['pg_dump_path'] = 'C:/xampp/PostgreSQL/13/bin/pg_dump';
    $conf['servers'][0]['pg_dumpall_path'] = 'C:/xampp/PostgreSQL/13/bin/pg_dumpall';
    $conf['default_lang'] = 'auto';
    $conf['autocomplete'] = 'default on';
    $conf['extra_login_security'] = false;
    $conf['owned_only'] = false;
    $conf['show_comments'] = true;
    $conf['show_advanced'] = false;
    $conf['show_system'] = false;
    $conf['min_password_length'] = 1;
    $conf['left_width'] = 200;
    $conf['theme'] = 'default';
    $conf['show_oids'] = false;
    $conf['max_rows'] = 30;
    $conf['max_chars'] = 50;
    $conf['use_xhtml_strict'] = false;
    $conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/';
    $conf['ajax_refresh'] = 3;
    $conf['plugins'] = array();
    $conf['version'] = 19;   
?>

这是我的phppgadmin config 和评论。 这是我的 apache config,以防万一。

我做错了什么,我该如何纠正?

GGsnake 回答:Windows 上的 PHPPGAdmin 给出了一个“虚拟类——无法实例化”错误

您在运行 PHP 8 吗?我正在运行 Linux,但我在 phppgadmin 中得到了这个,因为 php 更新到 v8,在 PHP v7 上运行良好。您可能需要等到一些修复程序合并到 phppgadmin 中才能与 PHP 8 一起使用。

,

我必须编辑 C:\xampp\phpPGadmin\libraries\adodb\adodb.php 脚本以注释掉其中包含 'Virtual Class -- cannot instantiate' 的行。这让它起作用了!

/**
 * Constructor
 */
/**
function __construct()          
{
    die('Virtual Class -- cannot instantiate');
}
*/

这可能不是最好的解决方案,但确实有效。如果有人有更好的答案,请随时加入。

本文链接:https://www.f2er.com/879422.html

大家都在问