Archived

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

couldn't compile IcePHP (Ice 3.3.1) with php 5.3.0

couldn't compile IcePHP (Ice 3.3.1) over php 5.3.0

i follow the instruction to edit the config/Make.rules modified the variable
PHP_HOME to /usr/local/php (my php installation directory , source compiled)
save and 'make'
after that i got 1 error:
Marshal.cpp: In constructor 'IcePHP::ObjectReader::ObjectReader(zval*, const Slice::ClassDefPtr&, void***)':
Marshal.cpp:1932: error: 'ZVAL_ADDREF' was not declared in this scope

full console log:
making all in src
make[1]: Entering directory `/home/user/setup/ice/Ice-3.3.1/php/src'
making all in IcePHP
make[2]: Entering directory `/home/user/setup/ice/Ice-3.3.1/php/src/IcePHP'
c++ -c -I.  -I../../../cpp/include -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/TSRM  -ftemplate-depth-128 -Wall -D_REENTRANT -I/usr/include/nptl -fPIC -g  Marshal.cpp
Marshal.cpp: In member function 'virtual void IcePHP::ObjectWriter::ice_preMarshal()':
Marshal.cpp:1838: warning: deprecated conversion from string constant to 'char*'
Marshal.cpp: In constructor 'IcePHP::ObjectReader::ObjectReader(zval*, const Slice::ClassDefPtr&, void***)':
Marshal.cpp:1932: error: 'ZVAL_ADDREF' was not declared in this scope
Marshal.cpp: In member function 'virtual void IcePHP::ObjectReader::ice_postUnmarshal()':
Marshal.cpp:1945: warning: deprecated conversion from string constant to 'char*'
Marshal.cpp: In member function 'virtual Ice::ObjectPtr IcePHP::PHPObjectFactory::create(const std::string&)':
Marshal.cpp:2235: warning: deprecated conversion from string constant to 'char*'
make[2]: *** [Marshal.o] Error 1
make[2]: Leaving directory `/home/user/setup/ice/Ice-3.3.1/php/src/IcePHP'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/user/setup/ice/Ice-3.3.1/php/src'
make: *** [all] Error 1

i compiled IcePy with python 2.6.2 ok,before php 5.3.0 i compiled IcePHP with php 5.2.8 is ok.
does that means Ice don't compatible with php 5.3 ? or i need to patch the file Marshal.cpp ?

my OS: ubuntu 9.04
GCC: 4.3.3
php:5.3.0

Comments

  • mes
    mes California
    Hi,

    You can fix the compilation error by replacing the ZVAL_ADDREF macro with Z_ADDREF_P in Marshal.cpp.

    Regards,
    Mark
  • thx it works!

    thx it works! :cool:
  • I encountered a problem similar to nickfan's but after applying the suggested correction get missing symbols for a bunch of zend functions.
    c++ -dynamiclib -O2 -DNDEBUG -arch i386 -arch x86_64 -arch ppc -ftemplate-depth
    -L../../../cpp/lib -lIce -lSlice -lIceUtil
    Undefined symbols:
    "_zend_object_store_get_object", referenced from:
    _handleGetMethod in Communicator.o
  • benoit
    benoit Rennes, France
    Hi,

    We don't really support building IcePHP on Mac OS X. If you need official support for this, please send us an email at info@zeroc.com. I assume you're using Mac OS X Snow Leopard here. Does PHP 5.3 shipped with Snow Leopard include a shared library for php in /usr/lib/php? If it does, you can try changing Ice-3.3.1/php/src/IcePHP/Makefile to try to link with this library. Otherwise, I believe you'll need to build PHP 5.3 from source.

    Cheers,
    Benoit.
  • I'm experiencing the same problems. The PHP5.3.0 that comes with Snow Leopard does not including a dylib. I've installed PHP5.3.0 with macports but it did not give me a dylib either, just a bundle:
    [peter@ /opt/local/apache2/modules]$ file libphp5.so 
    libphp5.so: Mach-O 64-bit bundle x86_64
    

    It did leave me with the following also:
    [peter@ /opt/local/lib/php/build]$ ls -l
    total 708
    -rw-r--r-- 2 root admin   5694 2009-11-08 09:36 Makefile.global
    -rw-r--r-- 2 root admin  75396 2009-11-08 09:36 acinclude.m4
    -rwxr-xr-x 2 root admin  43499 2009-11-08 09:36 config.guess
    -rwxr-xr-x 2 root admin  31743 2009-11-08 09:36 config.sub
    -rw-r--r-- 2 root admin 221742 2009-11-08 09:36 libtool.m4
    -rw-r--r-- 2 root admin 186760 2009-11-08 09:36 ltmain.sh
    -rw-r--r-- 2 root admin   2278 2009-11-08 09:36 mkdep.awk
    -rw-r--r-- 2 root admin   4636 2009-11-08 09:36 phpize.m4
    -rw-r--r-- 2 root admin  67707 2009-11-08 09:36 run-tests.php
    -rw-r--r-- 2 root admin    410 2009-11-08 09:36 scan_makefile_in.awk
    -rwxr-xr-x 2 root admin  61225 2009-11-08 09:36 shtool
    

    I dont know autoconf/automake well enough, but is that enough to build a dylib?

    It would be great if there was some more support for IcePHP on OSX as it's quite a popular developer environment these days.

    Thanks
    Peter