我刚刚从here(mini.iso)安装了一个新的ubuntu系统 我在安装过程中根本没有选择任何附加件。Apache不能编译php
现在,我写了一个简单的PHP测试脚本(/var/www/html/index.php )
<?php
echo "Hello World";
?>
然而,从另一台计算机调用该页面后,我从字面上得到的不是编译PHP从文件输出。
输出:
<?php
echo "Hello World";
?>
我已经重新启动的Apache2,没有变化。
Apache的版本:
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:32:47
PHP版本:
PHP 7.0.16-4+deb.sury.org~trusty+1 (cli) (built: Mar 2 2017 13:50:00) (NTS)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.16-4+deb.sury.org~trusty+1, Copyright (c) 1999-2017, by Zend Technologies
Linux版本的:
Linux的Linux的3.13.0-110泛型#157 Ubuntu的SMP Mon Feb 20 11:55:25 UTC 2017 i686 i686 i686 GNU/Linux
我已经搜索了互联网,其他一些用户说检查文件httpd.conf
是否加载PHP模块,但没有这样的文件。我通过使用find/-name "httpd.conf"
搜索它没有结果。
http://stackoverflow.com/questions/12142172/apache-shows-php-code-instead-of-executing – JustOnUnderMillions
http://stackoverflow.com/questions/5121495/php-code-is-not-being -executed-instead-code-shows-on-the-page – JustOnUnderMillions