我有一个安装了httpd web服务器和php作为CLI的新服务器。我可以在控制台中执行任何PHP脚本,但是当我将它放在一个文件中并在浏览器中调用它时,它会按原样输出PHP脚本。
基本上httpd不解析PHP脚本,因为mod_php之类的扩展或模块不可用。我在/etc/httpd/conf.modules.d
中看不到任何扩展名为.so的文件
/etc/php.d is empty
和
/etc/httpd/conf.modules.d has
[root@ip-10-227-85-145 conf.modules.d]# ll
total 32
-rw-r--r-- 1 root root 3739 Jun 22 2018 00-base.conf
-rw-r--r-- 1 root root 139 Jun 22 2018 00-dav.conf
-rw-r--r-- 1 root root 41 Jun 22 2018 00-lua.conf
-rw-r--r-- 1 root root 742 Jun 22 2018 00-mpm.conf
-rw-r--r-- 1 root root 957 Jun 22 2018 00-proxy.conf
-rw-r--r-- 1 root root 88 Jun 22 2018 00-systemd.conf
-rw-r--r-- 1 root root 451 Jun 22 2018 01-cgi.conf
-rw-r--r-- 1 root root 59 Mar 31 2016 10-auth_openidc.conf
我无能为力。 yum install php5-mcrypt
不工作。它给了我一些错误。
RHEL不支持mod_php。它使用fsm / fcgi - 这里提到 - https://aws.amazon.com/premiumsupport/knowledge-center/ec2-php56-apache-rhel72/