Question

I'm having a problem installing SAM 1.1.0 on fedora 16 same as here https://bugs.php.net/bug.php?id=59632&thanks=6

This problem is related to PHP libraries and I don't know much about how to solve related problems. I search the internet and can't find a solution, Please shed a light. Thanks.

[root@li3ro SAM-1.1.0]# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
[root@li3ro SAM-1.1.0]# ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for sam support... yes, shared
checking for sam xms support... yes, shared
checking for sam xms files in default path... found in /opt
checking for xmsConnFactCreate in -lgxi... no
configure: error: wrong sam XMS lib version or lib not found

This is the config.m4 :

dnl $Id: config.m4,v 1.4 2007/02/02 15:38:53 dsr Exp $
dnl config.m4 for extension sam

PHP_ARG_WITH(sam, for sam support,
 [  --with-sam             Include sam support])

PHP_ARG_WITH(sam_xms, for sam xms support,
 [  --with-sam_xms[=DIR]   Include sam_xms support])

if test "$PHP_SAM" != "no"; then

  PHP_NEW_EXTENSION(sam, php_sam.c, $ext_shared, , -DLINUX)

  if test "$PHP_SAM_XMS" != "no"; then

    dnl # --with-sam_xms -> check with-path
    SEARCH_PATH="/opt"
    SEARCH_FOR="/IBM/XMS/tools/c/include/xms.h"
    if test -r $PHP_SAM_XMS/; then # path given as parameter
      SAM_DIR=$PHP_SAM_XMS
    else # search default path list
      AC_MSG_CHECKING([for sam xms files in default path])
      for i in $SEARCH_PATH ; do
        if test -r $i/$SEARCH_FOR; then
          SAM_DIR=$i
          AC_MSG_RESULT(found in $i)
        fi
      done
    fi

    if test -z "$SAM_DIR"; then
      AC_MSG_RESULT([not found])
      AC_MSG_ERROR([Please reinstall the XMS distribution])
    fi

    dnl # --with-sam_xms -> add include path
    PHP_ADD_INCLUDE($SAM_DIR/IBM/XMS/tools/c/include)

    dnl # --with-sam_xms -> check for lib and symbol presence
    LIBNAME=gxi
    LIBSYMBOL=xmsConnFactCreate

    PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
     [
     PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SAM_DIR/IBM/XMS/lib, SAM_XMS_SHARED_LIBADD)
     AC_DEFINE(HAVE_SAMLIB,1,[ ])
    ],[
     AC_MSG_ERROR([wrong sam XMS lib version or lib not found])
    ],[
      -L$SAM_DIR/IBM/XMS/lib -lm -ldl
    ])

    PHP_SUBST(SAM_XMS_SHARED_LIBADD)

    PHP_NEW_EXTENSION(sam_xms, php_sam_xms.c SAM_XMS_Utils.c SAM_XMS_Connection.c, $ext_shared, , -DLINUX)

  fi
fi

Please note, I've installed the XMS and server is working.. I tried many things but none worked, What should I do?

Was it helpful?

Solution

Solution:

The linux machine is i686 , and there was no modules of xms for it (only 32bit and 64bit) after installing the same SAM and XMS on 64bit machine it found to right libraries

Hope this helps someone

OTHER TIPS

Possibly worth nothing that SAM itself is no longer being maintained. If you need to use MQTT from PHP there are other options listed via http://mqtt.org/software. In particular I don't believe that SAM supports MQTT 3.1 authentication username/password on API calls.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top