【发布时间】:2015-11-19 15:27:07
【问题描述】:
我有一个主要用 PHP 编写并使用 jQuery 的应用程序。我有一个新的 CentOS 虚拟机,我在 system-test/eabu-tools 目录下复制了应用程序名称 RCCA,并在 /var/www/html 目录中创建了一个链接 RCCA。
/var/www/html 的内容如下所示。
lrwxrwxrwx 1 root root 27 Aug 6 12:04 RCCA -> system-test/eabu-tools/RCCA
应用程序名称为 RCCA,如上图所示,在/var/www/html 目录内有一个名为 RCCA 的软链接。
当我使用 url http://hostname/RCCA/rcca.php 访问应用程序时。我得到的只是一个空白页面,当我查看页面的源代码时,我得到以下输出,但没有进一步,或者包含不起作用。
<body>
<div id="header">
<? include "header.php"?>
<?php include "navbar.php" ?>
</div>
<div id="context_container">
<div id="context_content">
<div id="navi"></div>
<div id="tabs-left">
<? include("tabsTemplate.php");?>
<div id="tabs-1" name="all-stats">
<div id="tabs-content">
<? include("all_rcca_sections.php");?>
</div>
</div>
<div id="tabs-2" name="stats1">
<div id="tabs-content">
<? include("rcca_sections1.php");?>
</div>
</div>
<div id="tabs-4">
<div id="tabs-content" name="stats2">
<? include("rcca_sections2.php");?>
</div>
</div> ... so on.
此外,相同的目录结构和应用程序在另一台服务器上运行良好。知道我在新 VM 上首次部署 PHP 时缺少什么吗?
【问题讨论】:
-
看起来 PHP 没有在服务器上运行,如果你在浏览器中看到 php 标签。还有简短的开放标签
-
@Alex2php,我是否需要启动任何特定模块来运行 php 或任何向后兼容的想法?
-
检查PHP是否在
php -v的服务器上运行,如果没有,你需要像sudo yum install php一样安装它。这是使用 CentOS 安装 LAMP 堆栈的完整指南:digitalocean.com/community/tutorials/… -
@Alex2php,是的,php 正在运行。输出是 [root@eabu-www-shell03 html]# php -v PHP 5.1.6 (cli) (build: Jun 27 2012 12:21:13) 版权所有 (c) 1997-2006 The PHP Group Zend Engine v2. 1.0,版权所有 (c) 1998-2006 Zend Technologies
-
@Alex2php "sudo yum install php" 解决了这个问题。请输入答案部分,以便我可以接受它作为答案。
标签: php linux apache http centos