【问题标题】:Fatal error: Call to undefined function __() in phpMyAdmin致命错误:在 phpMyAdmin 中调用未定义的函数 __()
【发布时间】:2014-10-25 01:56:06
【问题描述】:

我已经阅读了here 和其他各种链接,但我无法追踪问题...我刚刚安装了 Apache24、PHP5、Mysql(这些年来我已经做过几次)和 phMyAdmin这次只是没有“开箱即用”。

我的 info.php 显示 mysql 加载正常。我的 apache 服务器似乎运行正常并提供页面。但我无法追踪问题的根源。

我在 Windows 7 上...非常感谢您的指点...非常感谢。

确切错误:致命错误:在第 229 行调用 C:\Apache24\htdocs\phpmyadmin\libraries\core.lib.php 中未定义的函数 __()

调用堆栈 - 不确定如何生成...

围绕问题的代码行,第 229 行标记为:

function PMA_fatalError(
    $error_message, $message_args = null, $delete_session = true
) {
    /* Use format string if applicable */
    if (is_string($message_args)) {
        $error_message = sprintf($error_message, $message_args);
    } elseif (is_array($message_args)) {
        $error_message = vsprintf($error_message, $message_args);
    }

if ($GLOBALS['is_ajax_request']) {
    $response = PMA_Response::getInstance();
    $response->isSuccess(false);
    $response->addJSON('message', PMA_Message::error($error_message));
} else {
    $error_message = strtr($error_message, array('<br />' => '[br]'));

    /* Load gettext for fatal errors */
    if (!function_exists('__')) {
        include_once GETTEXT_INC;
    }

    // these variables are used in the included file libraries/error.inc.php
    $error_header = __('Error');  /* Line 229 */
    $lang = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
    $dir = $GLOBALS['text_dir'];

    // on fatal errors it cannot hurt to always delete the current session
    if ($delete_session
        && isset($GLOBALS['session_name'])
        && isset($_COOKIE[$GLOBALS['session_name']])
    ) {
        $GLOBALS['PMA_Config']->removeCookie($GLOBALS['session_name']);
    }

    // Displays the error message
    include './libraries/error.inc.php';
}
if (! defined('TESTSUITE')) {
    exit;
    }
}

/**

【问题讨论】:

  • 您能否粘贴确切的错误、调用堆栈和错误周围的代码行。由于这是一个问题,甚至无法开始猜测原因......

标签: phpmyadmin


【解决方案1】:

检查您的会话目录是否可被网络服务器进程写入。

最好的方法是创建自己的 phpinfo 文件;在任何网络可访问的文件夹中创建一个包含以下内容的文件(您可以将其命名为 test.php 或 phpinfo.php 或任何您喜欢的名称):

<?php
phpinfo();
?>

在浏览器中打开该文件(http://localhost/test.php 或类似文件)并查找session.save_path 行。那是您的会话文件夹;确保权限合适,看看是否有帮助。

【讨论】:

    【解决方案2】:

    我还研究了here 和其他链接,但无济于事。我终于确定没有安装 PHP5 JSON 模块。您必须确定如何为您的平台安装它。它应该在您的 phpinfo 列表中显示为启用 JSON 支持。

    【讨论】:

      【解决方案3】:

      我在 Windows 上遇到了这个问题。执行以下操作:

      1. 关闭 Apache httpd(或您运行的任何服务器)

      2. 打开 php.ini 文件。如果你没有,请从 php.ini-production 或 php.ini-development 复制粘贴

      3. 取消注释“extension=php_mbstring.dll”和“extension=php_mysqli.dll”行

      4. 插入“extension_dir = full_path_to_your_ext_folder”行。您需要指向您的php安装的ext子文件夹,上面指定的dll文件所在的位置

      5. 保存并重启网络服务器

      【讨论】:

        猜你喜欢
        • 2015-02-16
        • 1970-01-01
        • 1970-01-01
        • 2017-03-24
        • 1970-01-01
        • 2015-02-04
        • 1970-01-01
        • 2014-02-10
        相关资源
        最近更新 更多