【发布时间】:2016-11-03 08:55:07
【问题描述】:
我已经在我的机器上安装了Apache2 和PHP 7 和(sudo apt-get install php7.0 php7.0-mcrypt)。当我在终端中点击php -v 时,它返回:
PHP 7.0.4-7ubuntu2.1 (cli) ( NTS ) 版权所有 (c) 1997-2016 PHP Group Zend Engine v3.0.0,版权所有 (c) 1998-2016 Zend Technologies 使用 Zend OPcache v7.0.6-dev,版权所有 (c) 1999-2016,由 Zend Technologies 提供
然后我在var/www/html/e.php 创建了一个PHP 文件,内容如下:
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
当我打开浏览器 (http://localhost/e.php) 时,它不显示 php 变量,只显示 html 标签。我错过了什么? Apache 的 Ubuntu “It Works”页面可以正常工作。
提前致谢。
【问题讨论】:
-
你的意思是看到页面上的PHP代码还是别的什么?
-
它没有显示任何关于 php 的信息,看起来我的机器上没有 php。 @JuliePelletier
-
@JulinhodaAdelaide 任何更新!