phpMyAdmin配置存储错误

时间:2014-03-27 20:58:35

标签: phpmyadmin

我在使用phpmyadmin 4.0.10时遇到了一个奇怪的问题。首先,我正在运行此版本,因为我的mysql版本是5.1.57。

我设置了phpmyadmin,除了存储设置外,其他所有配置。我已经创建了phpmyadmin数据库和必要的表。我还创建了pma用户并确保其所有权限都是正确的。在我的配置文件中,我添加了此用户的设置并复制了密码。

如果我在此时保存我的配置而没有实际设置存储数据库和表,一切正常。但是,如果我启用这些表,每当我尝试将列添加到表的结构时,我的日志中都会收到以下错误500消息。

PHP Fatal error:  Call to undefined function ._Application_Octetstream_Download_getInfo() in /htdocs/phpmyadmin/libraries/transformations.lib.php on line 153

知道这里发生了什么吗?我删除并重新创建了我的phpmyadmin数据库。我删除并重新创建了pma用户。我删除并重新创建了我的配置文件,这就是我最终将此错误跟踪到存储表的方式。

如果有帮助,这是导致transformations.lib.php文件中出现问题的一段代码:

/**
 * Returns the description of the transformation
 *
 * @param string  $file           transformation file
 * @param boolean $html_formatted whether the description should be formatted
 *                                as HTML
 *
 * @return String the description of the transformation
 */
function PMA_getTransformationDescription($file, $html_formatted = true)
{
    // get the transformation class name
    $class_name = explode(".class.php", $file);
    $class_name = $class_name[0];

    // include and instantiate the class
    include_once 'libraries/plugins/transformations/' . $file;
    return $class_name::getInfo();
}

1 个答案:

答案 0 :(得分:0)

查看完代码后,我最终得到了这个函数。

/**
 * Gets all available MIME-types
 *
 * @access  public
 * @staticvar   array   mimetypes
 * @return array    array[mimetype], array[transformation]
 */
function PMA_getAvailableMIMEtypes()
{
    static $stack = null;

    if (null !== $stack) {
        return $stack;
    }

    $stack = array();
    $filestack = array();

    $handle = opendir('./libraries/plugins/transformations');

    if (! $handle) {
        return $stack;
    }

    while ($file = readdir($handle)) {
        $filestack[] = $file;
    }

    closedir($handle);
    sort($filestack);

    foreach ($filestack as $file) {
        if (preg_match('|^.*_.*_.*\.class\.php$|', $file)) {
            // File contains transformation functions.
            $parts = explode('_', str_replace('.class.php', '', $file));
            $mimetype = $parts[0] . "/" . $parts[1];
            $stack['mimetype'][$mimetype] = $mimetype;
            $stack['transformation'][] = $mimetype . ': ' . $parts[2];
            $stack['transformation_file'][] = $file;

        } elseif (preg_match('|^.*\.class.php$|', $file)) {
            // File is a plain mimetype, no functions.
            $base = str_replace('.class.php', '', $file);

            if ($base != 'global') {
                $mimetype = str_replace('_', '/', $base);
                $stack['mimetype'][$mimetype] = $mimetype;
                $stack['empty_mimetype'][$mimetype] = $mimetype;
            }
        }
    }

    return $stack;
}

我的PHP技能有限但我可以告诉它读取插件/转换目录中的文件并将这些文件名返回到引用此函数的脚本。当我从终端浏览这个目录时,我注意到它已经被finder创建的._文件填满了。我使用mac来进行开发,并使用finder而不是wget来删除这个最新的phpmyadmin副本,因此创建了所有这些._文件。关于它们的一些东西弄乱了这个函数,一旦我在基层使用find命令删除它们,一切都按预期工作。这是任何遇到类似事情的人的查找命令:

find . -type f -name '._*' -exec rm {} \;

再次,在phpmyadmin目录的基础级别运行它,一切都应该很好。