[英]PHP code downloading instead of running on Apache server
So I'm new to server setup and I'm trying to get PHP 7.2 to run on an Ubuntu 18.04.3 LTS-based Apache2 server.所以我是服务器设置的新手,我试图让 PHP 7.2 在 Ubuntu 18.04.3 基于 LTS 的 ZA0196A9286E6FB036FE5670D6446 服务器上运行。 I have a simple phpinfo file:
我有一个简单的 phpinfo 文件:
<?php phpinfo(); ?>
which, when visited in a browser, downloads the file instead of running it.当在浏览器中访问时,它会下载文件而不是运行它。
Below are all of the steps I've followed thus far:以下是我到目前为止所遵循的所有步骤:
httpd.conf was not present; httpd.conf 不存在; I created it manually and added the following lines to it:
我手动创建了它并在其中添加了以下几行:
AddHandler application/x-httpd-php .php .phtml
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
apache2.conf: apache2.conf:
...
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Any ideas as to what I might still be missing?关于我可能仍然缺少什么的任何想法?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.