phpmyadmin显示代码而不是常规页面

时间:2017-07-05 04:13:36

标签: php mysql apache phpmyadmin

我在使用arch linux。我已经安装了apache 2.4.25,php 7.1.6和mysql 15.1 MariaDB。然后我安装了phpmyadmin,但在从浏览器访问http://localhost/phpadmin时,我得到了下面提到的代码而不是常规的phpmyadmin页面。我做错了什么?

以下是我得到的代码的第一部分:

isAjax() && ! empty($_REQUEST['recent_table'])){$response->addJSON( 'list', RecentFavoriteTable::getInstance('recent')->getHtmlList() ); exit; } if ($GLOBALS['PMA_Config']->isGitRevision()) { if (isset($_REQUEST['git_revision']) && $response->isAjax()) { PMA_printGitRevision(); exit; } echo '
'; } // Handles some variables that may have been sent by the calling script $GLOBALS['db'] = ''; $GLOBALS['table'] = ''; $show_query = '1'; // Any message to display? if (! empty($message)) { echo PMA\libraries\Util::getMessage($message); unset($message); } if (isset($_SESSION['partial_logout'])) { Message::success( __('You were logged out from one server, to logout completely from phpMyAdmin, you need to logout from all servers.') )->display(); unset($_SESSION['partial_logout']); } $common_url_query = URL::getCommon(); $mysql_cur_user_and_host = ''; // when $server > 0, a server has been chosen so we can display // all MySQL-related information if ($server > 0) { include 'libraries/server_common.inc.php'; // Use the verbose name of the server instead of the hostname // if a value is set $server_info = ''; if (! empty($cfg['Server']['verbose'])) { $server_info .= htmlspecialchars($cfg['Server']['verbose']); if ($GLOBALS['cfg']['ShowServerInfo']) { $server_info .= ' ('; } } if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) { $server_info .= $GLOBALS['dbi']->getHostInfo(); } if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) { $server_info .= ')'; } $mysql_cur_user_and_host = $GLOBALS['dbi']->fetchValue('SELECT USER();'); // should we add the port info here? $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host']); } echo '
' , "\n"; // Anchor for favorite tables synchronization. echo RecentFavoriteTable::getInstance('favorite')->getHtmlSyncFavoriteTables(); echo '
'; if ($server > 0 || count($cfg['Servers']) > 1 ) { if ($cfg['DBG']['demo']) { echo '
'; echo '
' , __('phpMyAdmin Demo Server') , '
'; echo '

'; printf( __( 'You are using the demo server. You can do anything here, but ' . 'please do not change root, debian-sys-maint and pma users. ' . 'More information is available at %s.' ), 'demo.phpmyadmin.net' ); echo '
'; echo '
'; } echo '
'; echo '

事实上,我在php中编写的代码运行良好,只是phpmyadmin页面没有显示。例如,我尝试了phpinfo(),它显示了页面。

好的,最后按照an answer of this post中的建议将其添加到我的httpd.conf文件中。谢谢你试图帮助我。

# PHP 7 specific configuration
<IfModule php7_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>

0 个答案:

没有答案