在centos中从源代码构建php 5.5,缺少mod_php [英] building php 5.5 from source in centos, missing mod_php
问题描述
我正在使用以下命令从源代码构建php 5.5:
I am building php 5.5 from source using this command:
sudo ./configure --enable-mbstring --enable-intl --with-gd --with-mysql --with-pdo-mysql --with-curl --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --includedir=/usr/include --prefix=/opt/php5
然后
sudo make install
在编译过程中完全没有问题,最后我可以做php -v,这给了我正确的版本php,但问题是当我尝试使用httpd(apache)并执行 http:// localhost时,我可以看到php源代码。
No problems at all during compiling and I can do php -v at the end which gives me the right version of php but the problem is when I try to use httpd (apache) and when I do 'http:// localhost' I can see php source code.
我无法启用mod_php,我的/ etc / httpd / modules /目录中没有mod_php。我需要做些什么来创建mod_php以便可以在httpd(Apache)服务器中启用它?
I cannot enable mod_php and there is no mod_php in my /etc/httpd/modules/ directory. What do I need to do to create a mod_php so I can enable it in httpd (apache) server?
推荐答案
包括
--with-apxs2
,在重新编译之前,我必须先安装:
and before recompiling I had to install:
sudo yum install httpd-devel
然后别忘了包含在虚拟主机中:
Then dont forget include in vhost:
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
</IfModule>
这篇关于在centos中从源代码构建php 5.5,缺少mod_php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!