Multiple PHP SAPI configuration

Posted by DTest on Server Fault See other posts from Server Fault or by DTest
Published on 2010-12-22T14:47:13Z Indexed on 2010/12/22 14:55 UTC
Read the original article Hit count: 427

Filed under:
|
|

I'm trying to build PHP for use as an apache shared module --with-apxs2 but also with the 'php-cgi' binary (fastcgi) on Mac OSX 10.6. I'm using this ./configure :

/configure --prefix=/usr/local/PHP \
--with-apxs2=/usr/local/apache/bin/apxs  \
--disable-ipv6 \
--enable-cgi \
--with-curl \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-openssl=/usr \
--enable-ftp \
--enable-shared \
--enable-soap \
--enable-sockets \
--enable-zip \
--with-zlib-dir

It builds the apache php5.so module just fine, but in /usr/local/PHP/bin, there is no php-cgi file. If I build it without the --with-apxs2 option (and indeed, I don't even need the --enable-cgi option) the php-cgi file gets built with no problems.

Background on my setup: PHP 5.3.4, Apache 2.2.14, Mac OSX 10.6, Tomcat with JavaBridge (which is why I need the php-cgi file)

Without the apxs2 option, /usr/local/php/bin/php -v produces:

PHP 5.3.4 (cli) (built: Dec 21 2010 21:35:14) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

and /usr/local/php/bin/php-cgi -v produces:

PHP 5.3.4 (cgi-fcgi) (built: Dec 21 2010 21:35:12)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

My question is, what am I not understanding with php SAPIs that won't allow the building of the two modules at the same time? Also, can I build it --with-apxs2 the first time, then make clean and rebuild in the same PHP directory /usr/local/php for the php files without issue?

© Server Fault or respective owner

Related posts about php

Related posts about apache2