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