building php 5.5 from source in centos, missing mod_php

守給你的承諾、 提交于 2019-12-24 08:19:17

问题


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

then

sudo make install

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.

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?


回答1:


I had to include

 --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>


来源:https://stackoverflow.com/questions/25302891/building-php-5-5-from-source-in-centos-missing-mod-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!