Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice 3.4.1 for PHP on Mac Os Snow Leopard

Hi,

I am sorry, but I am experiencing problems with setup Ice 3.4.1 for PHP on Mac.

I have successfully compiled it for cpp, but not for php.

So I am gettings such errors

Undefined symbols:
_zend_hash_get_current_data_ex
_add_property_long_ex
...
_zend_update_property_long
_zend_register_ini_entries


But I have this functions in Zend.
grep add_property_long_ex Zend/zend_API.h
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)

I have specified correct PHP_HOME.
Also while compiling I can see that PHP_INCLUDE_DIR and PHP_LIB_DIR are correct.

Can you please advice what I need to do?

Comments

  • mes
    mes California
    Hi,

    The standard PHP installation on Snow Leopard does not include the link library required by the Ice extension, which is why the build fails with undefined symbols. You might want to try installing the PHP packages from MacPorts instead; I can't guarantee that it will work, but the fact that MacPorts provides a php5-devel package is promising.

    Regards,
    Mark
  • Him thanks for your reply,
    I have install php5-devel and got exact the same errors.
    I have verified that I am using correct php installation.

    I am sorry, but maybe you have any other ideas?

    Thanks!
  • matthew
    matthew NL, Canada
    Is the location of the required library in your libpath? (Check the -L flag in the link line). It would be far more helpful if you pasted the output of the link line including all errors.
  • Thanks for the reply. yes it is.

    So in my config/Make.rules.php file I have
    PHP_HOME ?= /opt/local

    While doing make I can see
    -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/Zend -I/opt/local/include/php/

    The exact error is
    c++ -dynamiclib -g -Wall -D_REENTRANT -L../../lib -o ../../lib/IcePHP.dy -install_name /opt/Ice-3.4/lib/IcePHP.dy Communicator.o Connection.o Endpoint.o Init.o Logger.o Operation.o Properties.o Proxy.o Types.o Util.o -L/Users/oksanatkanko/Software/Developer/Ice/lib -lIce -lSlice -lIceUtil
    Undefined symbols:
    "_zend_hash_get_current_data_ex", referenced from:
    IcePHP::OperationI::convertParams(_zval_struct*, std::vector<IceUtil::Handle<IcePHP::TypeInfo>, std::allocator<IceUtil::Handle<IcePHP::TypeInfo> > >&, bool&)in Operation.o

    ....
  • I can compile for cpp, but not for php too on mac os 10.5.8

    errors: Undefined symbols ...

    after read this: Compile IcePHP 3.2 with PHP 5.2.3 on Mac Osx Compile IcePHP 3.2 with PHP 5.2.3 on Mac Osx : N.S.thoughts

    I compile success finally :)

    copy cpp/config/Makefile.rules.Darwin to php/config and edit
    #LDPLATFORMFLAGS += -rdynamic
    LDPLATFORMFLAGS = -Wl,-bind_at_load

    #ifdef ice_src_dist
    # shlibldflags = $(CXXFLAGS) -L$(libdir)
    #else
    # shlibldflags = $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)
    #endif

    shlibldflags = $(CXXFLAGS) ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -L$(libdir)
  • Hi, thanks a lot! That is awesome.
    Now I have /opt/Ice-3.4.1/php/
    but I don't now how to connect ice with php.
    Can you please help me a bit?

    I can't find IcePHP.so, only IcePHP.dy

    now sure what is the correct way to load it...
  • oksanat wrote: »
    Hi, thanks a lot! That is awesome.
    Now I have /opt/Ice-3.4.1/php/
    but I don't now how to connect ice with php.
    Can you please help me a bit?

    I can't find IcePHP.so, only IcePHP.dy

    now sure what is the correct way to load it...
    :)


    sudo cp /opt/Ice-3.4.1/php/IcePHP.dy /opt/local/lib/php/extensions/no-debug-non-zts-20090626/IcePHP.so