在我的LAMP堆栈上遇到PHP问题:根本没有解析PHP脚本。我安装的Ubuntu 13.10清楚机上......我看现在唯一明确的HTML页面,从PHP,但标签文本一样,LAMP堆栈的PHP不工作(Ubuntu 13.10/Apache 2.4.6)
其实,我有什么:
$/usr/sbin目录/ apache2ctl状态| grep的版
Server Version: Apache/2.4.6 (Ubuntu) PHP/5.5.3-1ubuntu2.1
$尾-n 1 /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
VirtualHost configuration:
*:80 is a NameVirtualHost
default server videosurgeon.ll (/etc/apache2/sites-enabled/vs.conf:1)
port 80 namevhost videosurgeon.ll (/etc/apache2/sites-enabled/vs.conf:1)
port 80 namevhost videosurgeon.ll (/etc/apache2/sites-enabled/vs.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
$ apache2ctl -M | grep的PHP
php5_module (shared)
$猫/work/VS/httpdocs/test.php
<? phpinfo(); ?>
$猫/etc/apache2/sites-enabled/vs.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName videosurgeon.ll
DirectoryIndex index.php index.html index.htm
DocumentRoot /work/VS/httpdocs/
<Directory /work/VS/httpdocs/>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,alert, emerg.
LogLevel notice
CustomLog /var/log/apache2/access.log combined
</virtualHost>
$在/ usr/bin中/ PHP - 版本
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
UPD.1:这是我的apache2.conf:http://ge.tt/6Yd8Jj91/v/0
UPD.2:今天我умут试图删除一切,只是重新安装LAMP。结果是完全一样的:PHP不起作用。
sudo apt-get install lamp-server^
但同样有趣的是phpMyAdmin的正常工作。如果你有你的httpd这些行
sudo apt-get install php5 php5-cgi phpmyadmin
事实证明,有(在phpMyAdmin)有一些设置,给它使用PHP ...
你是否安装了modphp。你当然可以把已经安装了PHP的非Apache的版本:尝试'易于得到安装的Apache2 -y-MOD-PHP5;服务的Apache2 restart' – ldrumm
如果上述建议失败,你也可以尝试位于tasksel的“LAMP服务器”选项($ sudo的工具tasksel)。 – TeTeT
我遇到同样的问题。在debian上构建开发环境。你最终找到了解决这个问题的办法吗? – Pitt