灯组';s PHP不工作(Ubuntu 13.10/Apache 2.4.6)

灯组';s PHP不工作(Ubuntu 13.10/Apache 2.4.6),php,apache,ubuntu,lamp,Php,Apache,Ubuntu,Lamp,我的LAMP堆栈上的PHP有问题:根本没有解析PHP脚本。我在clear machine上安装了Ubuntu13.10。。。我现在看到页面上只有清晰的HTML,但PHP标记就像文本一样 事实上,我所拥有的: $/usr/sbin/apache2ctl状态| grep版本 $tail-n1/var/log/apache2/error.log [Sat Dec 14 19:33:16.307184 2013] [core:notice] [pid 15457] AH00094: Command li

我的LAMP堆栈上的PHP有问题:根本没有解析PHP脚本。我在clear machine上安装了Ubuntu13.10。。。我现在看到页面上只有清晰的HTML,但PHP标记就像文本一样

事实上,我所拥有的:

$/usr/sbin/apache2ctl状态| grep版本

$tail-n1/var/log/apache2/error.log

[Sat Dec 14 19:33:16.307184 2013] [core:notice] [pid 15457] AH00094: Command line: '/usr/sbin/apache2'
$apache2ctl-S

$apache2ctl-M|grep php

$cat/work/VS/httpdocs/test.php


UPD.1:这是我的apache2.conf:


UPD.2:今天我试图移除所有东西,只需重新安装灯。结果完全一样:PHP不起作用。

sudo apt-get install lamp-server^
但有趣的是,phpmyadmin工作得很好。我只是将其安装为:

sudo apt-get install php5 php5-cgi phpmyadmin 

事实证明(在phpmyadmin中)有一些设置允许它使用PHP…

检查httpd.conf中是否有以下行:

AddType  application/x-httpd-php         .php
AddType  application/x-httpd-php-source  .phps
还要确保您的php模块已加载:

LoadModule php5_module        modules/mod_php55.so

之后,重新启动apache并在重试之前清除浏览器的缓存。

也有同样的问题。您必须使用
标记作为PHP源代码,并将其作为PHP源代码进行处理。一直都是这样
; 建议您在几年内不要使用短标签“捷径”和
; 而是使用完整的标记组合。广泛使用
; 使用XML和其他语言使用这些标记,服务器可以变得很容易
; 困惑并最终在错误的上下文中解析错误的代码。但是因为
; 这条捷径已经成为一个功能这么长时间了,它目前仍然是
; 支持向后兼容,但我们建议您不要使用它们。
; 默认值:On
; 开发价值:关闭
; 产值:关
; http://php.net/short-open-tag
短\打开\标记=打开

由于某些原因,默认虚拟主机在默认情况下不执行php:

显式启用php引擎:

<IfModule mod_php5.c>
    php_admin_flag engine on
</IfModule>

php_admin_标志引擎打开

hure安装了modphp后,您是否可以使用它。您可能已经安装了一个非apache版本的php:try
apt-get-install-y apache2-mod-php5;service apache2 restart
如果上述建议失败,您也可以尝试tasksel($sudo tasksel)中的“LAMP服务器”选项。我也遇到了同样的问题。在debian上构建开发环境。您最终找到了这个问题的解决方案吗?根本没有httpd.conf存在apache2.confApache在基于Debian的安装中不使用httpd.conf。它们在/etc/apache2/sites enabled中有一个基于站点的配置,允许您使用a2ensite和A2Dispate来启用/禁用某些虚拟主机的配置文件。它们还有一个名为apache2.conf的中央配置文件。请尝试将Sebas列出的内容放入apache2.conf或相关站点配置文件中的sites enabled中。
PHP 5.5.3-1ubuntu2.1 (cli) (built: Dec 12 2013 04:22:11) 
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
sudo apt-get install lamp-server^
sudo apt-get install php5 php5-cgi phpmyadmin 
AddType  application/x-httpd-php         .php
AddType  application/x-httpd-php-source  .phps
LoadModule php5_module        modules/mod_php55.so
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = On
<IfModule mod_php5.c>
    php_admin_flag engine on
</IfModule>