我需要 libphp7.so 模块来在 Centos 上配置 apache
我按照这个 link 的教程在我的 Centos 6.5 和 apache 上使用 php7 或 phpng.
I follow the tutorial of this link to use php7 or phpng on my Centos 6.5 with apache.
我可以在控制台中执行 php 脚本,但我希望能够使用 Apache 服务器运行 php 脚本.
I can execute php scripts in the console but I would like to be able to run php scripts using the Apache Server.
我需要一些帮助,因为我找不到 libphp7.so 模块.我不知道我是否必须构建它或什么.
I need some help because I can't find the libphp7.so module. I don't know if I have to build it or what.
推荐答案
我相信你需要将 --with-apxs2
添加到你的配置脚本中.根据您提供的链接,我在配置标志中没有看到.--with-apxs2
将构建共享的 Apache 2.0 处理程序模块".您可能还需要确保在您的 apache 配置中拥有:
I believe you need to add --with-apxs2
to your configure script. According to the link you provided I do not see that in the configure flags. --with-apxs2
will "Build shared Apache 2.0 Handler module". You may also need to make sure in your apache configuration you have:
<FilesMatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
我第一次构建 php7 时它只是显示源代码而不是执行它,但是添加它会导致它执行代码.
The first time I built php7 it just displayed the source rather than execute it, but adding that caused it to execute the code.
如果你想用 Docker 试试,我刚刚在 https://registry.hub.docker.com/u/silintl/php7/ 您也可以只查看 Dockerfile,其中包含用于安装和配置它的所有命令.
If you want to try it out with Docker I just created a Docker image for PHP7 at https://registry.hub.docker.com/u/silintl/php7/ You can also just view the Dockerfile which includes all the commands used to install and configure it.
相关文章