Is it possible to compile ICE-php for PHP 5.5?

NielsNiels Member Niels HendriksOrganization: PersonalProject: PHP -> Murmur (Mumble Server) communication
Hello,

I realize that PHP 5.5 is officially not supported yet, I gave it a try anyways. Upon compiling I get the following error:
making all in src
make[1]: Entering directory `/root/php-fpm/Ice-3.5.0/php/src'
making all in IcePHP
make[2]: Entering directory `/root/php-fpm/Ice-3.5.0/php/src/IcePHP'
g++ -c -I.  -DICEPHP_USE_NAMESPACES -I../../../cpp/include -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -DPHP_DEBUG -m64 -Wall -Werror -D_REENTRANT -fPIC -O2 -DNDEBUG Communicator.cpp
Communicator.cpp: In function 'bool IcePHP::communicatorInit()':
Communicator.cpp:1344:5: error: expected ',' or ';' before string constant
Communicator.cpp:1344:5: error: expected ')' before string constant
make[2]: *** [Communicator.o] Error 1
make[2]: Leaving directory `/root/php-fpm/Ice-3.5.0/php/src/IcePHP'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/root/php-fpm/Ice-3.5.0/php/src'
make: *** [all] Error 1

Is this because it is not yet supported, or am I doing something wrong here? If it is because PHP 5.5 is not yet supported, is there any ETA for this?

Thanks!

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    This is a problem building IcePHP using PHP namespaces, you should try the patch posted here:

    http://www.zeroc.com/forums/patches/6011-patch-ice-3-5-0-allow-building-icephp-php-namespaces.html

    That will be fixed in Ice-3.5.1
  • NielsNiels Member Niels HendriksOrganization: PersonalProject: PHP -> Murmur (Mumble Server) communication
    Hi Jose,

    Thanks for your response. With the supplied patch I was able to make some progress. I have succesfully loaded the ICE extension in PHP 5.5 now, but it seems (at least, I think) that some of the generated php files are invalid.

    Here's what I see in the log:
    2013/07/16 14:23:00 [error] 28113#0: *169 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Ice\LocalException' not found in /opt/Ice-350/php/lib/Ice/LocalException.php on line 35" while reading response header from upstream, client: 192.168.1.151
    

    And here's the code around line 35:
    namespace Ice
    {
        if(!class_exists('\\Ice\\InitializationException'))      
        {
            class InitializationException extends \Ice\LocalException      
            {
                public function __construct($reason='')
                {
                    $this->reason = $reason;
                }
    
                public function ice_name()
                {
                    return 'Ice::InitializationException';      
                }
    
                public function __toString()
                {
                    global $Ice__t_InitializationException;      
                    return IcePHP_stringifyException($this, $Ice__t_InitializationException);      
                }
    
                public $reason;
            }
    
            $Ice__t_InitializationException = IcePHP_defineException('::Ice::InitializationException', '\\Ice\\InitializationException', false, null, array(
                array('reason', $IcePHP__t_string, false, 0)));
        }
    }
    

    As you can see, it is using backslashes. I also have a 3.4.2 Ice from the repository which doesn't have those backslashes. Is this something I'm doing wrong?

    Thanks,
    Niels
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    If you are using Ice PHP to setup mumble, i think the problem is that mumble requires non namespaces build of Ice. So you shouldn't be setting USE_NAMESPACES=yes when you build Ice for php.

    When you build Ice for php with namespaces enabled you should include 'Ice_ns.php' instead of 'Ice.php'.
  • NielsNiels Member Niels HendriksOrganization: PersonalProject: PHP -> Murmur (Mumble Server) communication
    Hi,

    Thanks - Got it working now.

    As a sidenote, for other people who come across the same problem, I had to change the EncodingVersion to 1.0 because Murmur (At time of writing) did not support 1.1. I did it like this, per instructions here Setting Properties - Ice 3.5 - ZeroC at the bottom:
    $settings = Ice_createProperties($args);
    $settings->setProperty("Ice.Default.EncodingVersion", "1.0");
    $id = new Ice_InitializationData();
    $id->properties = $settings;
    $ICE = Ice_initialize($id);
    

    Thanks again for the help.

    Niels
Sign In or Register to comment.