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

Hao Zhang hao at zhang.nu
Wed Nov 18 11:02:33 EST 2009


Hi Norm,

Yes, I changed fgs-dev/pkg_def/php/fgs_build file, but the changes are only
about (1) disable mysql support (2) enable debug mode which were discussed
in our previous emails. I opened this fgs_build file and noticed the
following section:

## need to verify that MapServer version is greater than or equal to
4.5

## if yes compile php as an Apache
module

## if version is 5.0 and up compile as an Apache
module

if [ -e $MS_SRC_PATH/map.h ] ; then
  MS_VERSION=`grep VERSION $MS_SRC_PATH/map.h | cut -d'"' -f2 `

  if [ `echo $MS_VERSION | cut -d'.' -f1` -eq 4 ] ; then
    [ `echo $MS_VERSION | cut -d'.' -f2` -ge 5 ] && PHP_AS_APACHE_MODULE=y
  fi
elif [ -e $MS_SRC_PATH/mapserver.h ] ; then
  PHP_AS_APACHE_MODULE=y
fi

APACHE_VERSION=`grep ^apache: $FGS_DEV_HOME/build.list | cut -d: -f3`
APACHE_VERSION_MAJOR=`echo $APACHE_VERSION | cut -d. -f1`

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?

Regards,
Hao


On Wed, Nov 18, 2009 at 4:18 PM, Normand Savard <nsavard at mapgears.com>wrote:

> Hao,
>
> Answer inline.
>
>
> Regards,
>
> Norm
>
> Hao Zhang wrote:
>
>> There is no php5 in my cgi-bin ($FGS_HOME/www/cgi-bin/). I checked your
>> FGS (1.0), there is no php5 in the cgi-bin as well. I compared php5.conf
>> files:
>>
>> [Your version - FGS 1.0]:
>> AddType application/x-httpd-php .php .phtml
>> LoadModule php5_module        libexec/libphp5.so
>> DirectoryIndex index.php index.phtml
>> PassEnv PHPRC
>>
>>  This indicates that PHP is compiled as a module.  This is the normal
> configuration of this package.  You could see this in the fgs_build of this
> package.
>
>
>  [My version]:
>> AddType application/x-httpd-php5 .php .phtml
>> Action application/x-httpd-php5 /cgi-bin/php5
>> DirectoryIndex index.php index.phtml
>> PassEnv PHPRC
>>
>>  PHP is compiled as a cgi.  Somehow it happens that the conf file
> "php.conf-php_as_cgi" is executed instead of "php.conf-php_as_module".
>
>  However, I cannot find libphp5.so anyway in my $FGS_HOME (no
>> $FGS_HOME/www/libexec at all!). Do you think it is because php is built or
>> configured wrong?
>>
>>  Did you change something in your fgs_build?  You could check how php is
> compiled in your php/config.log and php/config.status.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/foss-gis-suite/attachments/20091118/90619518/attachment.htm 


More information about the Foss-gis-suite mailing list