在 RedHat 上安装 PHP

Joh*_*n R 1 linux php redhat

我只是yum install php在命令提示符下运行。根据对话,一切顺利(“完成!”)。然后我上传了一个不使用短标签并以适当的扩展名命名的文件(即,名称是 test.php)。

<?php print "hello world"; ?>
Run Code Online (Sandbox Code Playgroud)

当我将浏览器导航到 test.php 时,它只打印上面显示的每个字符;即,PHP 没有解释它。

可能是什么问题?另外,如果有需要更新的配置文件,请告诉我我可能会找到该文件的目录路径。

编辑: Apache2 & Red Hat Enterprise 5.5

ckl*_*orn 7

尝试

yum install mod_php 
Run Code Online (Sandbox Code Playgroud)

这将为 Apache 加载 php 模块。