311*_*731 4 php apache phpmyadmin
我正在升级我的发行版,从kali(wheezy)到sid.但是当我设置我的网络服务器时,我重新安装了所有,apache2,php,mysql等,但是当我访问时我得到了这个错误localhost/phpmyadmin:该URL没有显示phpmyadmin的索引/登录页面,但显示了代码.在我/var/www的默认值是index.html,我将它重命名为index.php,没关系,页面已加载,我在/var/www我添加index.php或foo.php的其他目录中也一样,访问它,没问题,但当我输入phpmyadmin它显示代码.我尝试安装phpminiadmin和adminer,但我得到了同样的错误,两者都显示的代码,而不是网页.
这是我的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
并且没有发现任何错误 my /var/log/apache2/*log
我发现这个Localhost/phpmyadmin /返回php代码但没有帮助.
所以我的服务器有什么问题?
编辑1:像@Matt在第一条评论中所说.libapache2-mod-php5没有安装,所以我用apt-getrepo 安装它.
apt-get install libapache2-mod-php5
但它返回一个错误,像这样.
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,去localhost/phpmyadmin和它的工作.谢谢你的哑光.
小智 9
尝试这个
sudo apt-get install libapache2-mod-php7.0
这会为 apache2 安装库以使用 php7.0
请检查下面的东西,从一些差异链接找到你:
 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
谢谢