phpmyadmin apache配置索引.php

phpmyadmin apache配置索引.php,php,apache,phpmyadmin,Php,Apache,Phpmyadmin,我试图在Apache中使用phpMyAdmin,因此下载了它们,在线阅读,我必须将index.html更改为index.php,以便在访问localhost/phpMyAdmin时获得正确的pg。然而,当我这样做的时候,其他的东西出现了…帮帮我 当我键入localhost/phpmyadmin时,它会这样说 <?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Main loader script * * @package Php

我试图在Apache中使用phpMyAdmin,因此下载了它们,在线阅读,我必须将index.html更改为index.php,以便在访问localhost/phpMyAdmin时获得正确的pg。然而,当我这样做的时候,其他的东西出现了…帮帮我

当我键入localhost/phpmyadmin时,它会这样说

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Main loader script
 *
 * @package PhpMyAdmin
 */

/**
 * Gets some core libraries and displays a top message if required
 */
require_once 'libraries/common.inc.php';

/**
 * display Git revision if requested
 */
require_once 'libraries/display_git_revision.lib.php';

/**
 * pass variables to child pages
 */
$drops = array(
    'lang',
    'server',
    'collation_connection',
    'db',
    'table'
);
foreach ($drops as $each_drop) {
    if (array_key_exists($each_drop, $_GET)) {
        unset($_GET[$each_drop]);
    }
}
unset($drops, $each_drop);

/*
 * Black list of all scripts to which front-end must submit data.
 * Such scripts must not be loaded on home page.
 *
 */
 $target_blacklist = array (
    'import.php', 'export.php'
    );

// If we have a valid target, let's load that script instead
if (! empty($_REQUEST['target'])
    && is_string($_REQUEST['target'])
    && ! preg_match('/^index/', $_REQUEST['target'])
    && ! in_array($_REQUEST['target'], $target_blacklist)
    && in_array($_REQUEST['target'], $goto_whitelist)
) {
    include $_REQUEST['target'];
    exit;
}

// See FAQ 1.34
if (! empty($_REQUEST['db'])) {
    $page = null;
    if (! empty($_REQUEST['table'])) {
        $page = $GLOBALS['cfg']['DefaultTabTable'];
    } else {
        $page = $GLOBALS['cfg']['DefaultTabDatabase'];
    }
    include $page;
    exit;
}

/**
 * Check if it is an ajax request to reload the recent tables list.
 */
require_once 'libraries/RecentFavoriteTable.class.php';
if ($GLOBALS['is_ajax_request'] && ! empty($_REQUEST['recent_table'])) {
    $response = PMA_Response::getInstance();
    $response->addJSON(
        'list',
        PMA_RecentFavoriteTable::getInstance('recent')->getHtmlList()
    );
    exit;
}

if ($GLOBALS['PMA_Config']->isGitRevision()) {
    if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
        PMA_printGitRevision();
        exit;
    }
    echo '<div id="is_git_revision"></div>';
}
more.....

您需要启用apachephp模块。现在Apache不知道.php文件应该被解释为php脚本,所以您只需要获得文本输出。这里有文档记录:我猜php模块没有加载(参见步骤7),请检查您的
httpd.conf
,它通常位于
/etc/apache2/
中,它应该包含以下行:
loadmodulephp5\u module modules/libphp5.so
,它在Apache服务器中启用PHP模块。您还需要告诉Apache如何处理PHP文件,请参阅上面链接的步骤8。哦,配置完成后,别忘了重新启动Apache服务器!我已经解决了e问题…谢谢大家(: