[FGS] Starting apache error: httpd cannot execute binary file

Normand Savard nsavard at mapgears.com
Wed Nov 18 12:35:19 EST 2009

Hao Zhang wrote:
> if [ "$PHP_AS_APACHE_MODULE" = 'y' ] ; then
>     echo "* Building against mapserver >= 4.6, we can use PHP as an 
> Apache module"
>     OPTIONS="$OPTIONS --enable-cgi --enable-force-cgi-redirect"
>     if [ ${APACHE_VERSION_MAJOR} = '1' ] ; then
>         OPTIONS="$OPTIONS --with-apxs=$FGS_BUILD_HOME/apache/bin/apxs"
>     else
>         OPTIONS="$OPTIONS --with-apxs2=$FGS_BUILD_HOME/apache/bin/apxs"
>     fi
> else
>     OPTIONS="$OPTIONS --enable-cgi --enable-force-cgi-redirect"
> fi
> No matter "$PHP_AS_APACHE_MODULE" = 'y' or not, always has 
> OPTIONS="$OPTIONS --enable-cgi --enable-force-cgi-redirect". Is this 
> correct behavior?
I don't think this is what cause the problem even though it looks weird 
but you can change:

OPTIONS="$OPTIONS --enable-cgi --enable-force-cgi-redirect"

in the first "if" for:

OPTIONS="$OPTIONS --disable-cgi"

and for the "OPTIONS" in the else, you can change to:

OPTIONS="$OPTIONS --enable-force-cgi-redirect"

Then comment the following lines in fgs_build:

rm -rf $FGS_BUILD_HOME/php
make clean
make $FGS_MAKE_OPT all

Execute "./fgs_build" in the php src directory.  Paste the output 
related to Apache module or cgi here.



More information about the Foss-gis-suite mailing list