phpMyAdmin的显示code不是网页 [英] phpmyadmin displays code not web page

查看:202
本文介绍了phpMyAdmin的显示code不是网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级我的发行,从卡莉(喘息)SID来。但是,当我建立我的网络服务器,我重新安装全部结束,的Apache2,PHP和MySQL等,但是当我访问本地主机/ phpmyadmin的我得到这个错误:该URL没有显示的phpmyadmin指数/登录页面,而是显示了code。在我的 /无功/网络默认为index.html的,我给它改名到index.php,而且它的确定,加载页面时,我与我的其他目录相同在 /无功/网络我添加的index.php或foo.php和访问它,没有问题,但是当我输入的phpmyadmin 它显示code。我尝试安装 phpminiadmin adminer ,但我得到了同样的错误,两者都显示了code和不网页

I was upgrading my distro, from kali(wheezy) to sid. But when I was setting up my web server, I reinstalled all over, apache2, php, mysql etc., but I get this error when I access localhost/phpmyadmin: that URL is not showing an index / login page of phpmyadmin, but showing the code. In my /var/www the default is index.html, I renamed it to index.php, and it's ok, page is loaded, I do the same with my other directory in /var/www I added index.php or foo.php and access it, no problem, but when I enter phpmyadmin it's showing code. I tried installing phpminiadmin and adminer, but I get the same error, both are showing the code and not the web page.

下面是我的 apache2.conf
http://pastebin.com/MLYNQc6S

和这里是我的规格:

#php -v
PHP 5.5.7-2 (cli) (built: Dec 13 2013 00:25:07) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans



# mysql --version
mysql  Ver 14.14 Distrib 5.5.33, for debian-linux-gnu (i686) using readline 6.2


# apache2 -v
Server version: Apache/2.4.6 (Debian)
Server built:   Aug 12 2013 18:20:23


uname -a
Linux angga.id 3.7-trunk-686-pae #1 SMP Debian 3.7.2-0+kali8 i686 GNU/Linux

和没有在发现错误我的/ var /日志/的Apache2 / *登录

我发现这个<一个href=\"http://stackoverflow.com/questions/18060995/localhost-phpmyadmin-returns-php-$c$c\">Localhost/phpmyadmin/返回PHP code 但没有帮助。

I found this Localhost/phpmyadmin/ returns php code but didnt help.

有啥错了我的服务器?

编辑1:
像@马特在第一个评论说。 中的libapache2-MOD-PHP5 未安装,所以我用 apt-get的从回购安装。

EDIT 1 : Like @Matt said in first comment. libapache2-mod-php5 is not installed, so I installing it with apt-get from repo.

apt-get install libapache2-mod-php5

但它返回一个错误,是这样的。

but its return an error, like this.

dpkg: error processing libapache2-mod-php5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)

我打开突触和搜索中的libapache2-MOD-PHP5 有显示与该名称的两个包中的libapache2-MOD-php5filter 中的libapache2-MOD-PHP5 ,我检查了这一切,并安装它,成功,没有发现错误,
我重新启动的Apache2并转到本地主机/ phpmyadmin的及其工作。
感谢马特。

I open synaptic and search for libapache2-mod-php5 there are showing two package with that name libapache2-mod-php5filter and libapache2-mod-php5 , I check it all, and install it, success, no error found, i restart apache2 and go to localhost/phpmyadmin and its work. thanks for matt.

推荐答案

请检查下面的东西,已经找到了你的一些差异链接:

please check below things, have found for you from some diff links:

 1. Make sure that PHP is installed. This sounds silly, but you never   
    know.

 2. Make sure that the PHP module is listed and uncommented inside of your Apache's httpd.conf This should be something like
    LoadModule    php5_module "c:/php/php5apache2_2.dll" in the file.
    Search for    LoadModule php, and make sure that there is no comment
    (;) in front    of it.

 3. Make sure that the http.conf file has the PHP MIME type in it. This should be something like AddType application/x-httpd-php
    .php.    This tells Apache to run .php files as PHP. Search for
    AddType, and    then make sure there is an entry for PHP, and that
    it is uncommented.

 4. Make sure your file has the .php extension on it, otherwise it will not be executed as PHP.

 5. Make sure you are not using short tags in the PHP file (<?), these are deprecated, and usually disabled. Use <?php instead.
           Actually run your file over said webserver using an URL like http://localhost/file.php not via local access   
    file://localhost/www/file.php

或检查 http://php.net/install

感谢

这篇关于phpMyAdmin的显示code不是网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆