Archived

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

Ice 3.5.1 with IcePHP for 5.4.35 - CentOS 6.5 cPanel

Hi Guys,
I've been having an issue trying to get Ice 3.5.1 and IcePHP to work with PHP 5.4.35 and I have been unsuccessful for about 12 hours and I'm at my end.

CentOS 6.5 - cPanel
PHP 5.4.35

I have tried to install Ice 3.5.1 from yum repository, rpms, and source. I can get Ice to install/compile via source but I am unable to get IcePHP to compile. I have tried to install Ice via yum and then try and compile IcePHP and it can't find the Ice files it needs as if Ice wasn't installed.

I have installed db53, mcpp, etc. No matter what I try, I can't get Ice PHP to compile and get the IcePHP.so file.

Can someone tell me if this can be done? If so, HOW? The closest I got was with source compile Ice 3.5.1 and when I went to compile IcePHP the errors/output I got are below:
make[2]: Entering directory `/home/Ice-3.5.1/php/src/IcePHP'
../../../config/Make.common.rules:131: Found slice2php in both ICE_HOME/bin and ../../../cpp/bin, ICE_HOME/bin/slice2p$
g++ -c -I.  -I/opt/Ice-3.5.1/include -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/Zend -I/usr/include$
In file included from ./Communicator.h:13,
                 from Communicator.cpp:10:
./Config.h:45:17: error: php.h: No such file or directory
./Config.h:51:21: error: php_ini.h: No such file or directory
./Config.h:52:31: error: ext/standard/info.h: No such file or directory
./Config.h:53:29: error: zend_interfaces.h: No such file or directory
./Config.h:54:29: error: zend_exceptions.h: No such file or directory
./Config.h:104:9: error: #error "Unknown PHP version"
In file included from ./Communicator.h:13,
                 from Communicator.cpp:10:
./Config.h:60: error: âzend_module_entryâ does not name a type
./Config.h:80: error: expected constructor, destructor, or type conversion before â(â token
./Config.h:81: error: expected constructor, destructor, or type conversion before â(â token
./Config.h:82: error: expected constructor, destructor, or type conversion before â(â token
./Config.h:83: error: expected constructor, destructor, or type conversion before â(â token
./Config.h:84: error: expected constructor, destructor, or type conversion before â(â token
./Config.h:86: error: expected constructor, destructor, or type conversion before â(â token
./Config.h:93: error: expected constructor, destructor, or type conversion before â*â token
./Config.h:94: error: expected constructor, destructor, or type conversion before â(â token
In file included from Communicator.cpp:10:
./Communicator.h:31: error: âTSRMLS_Dâ was not declared in this scope
./Communicator.h:32: error: âTSRMLS_Dâ was not declared in this scope
./Communicator.h:33: error: âTSRMLS_Dâ was not declared in this scope
./Communicator.h:34: error: âTSRMLS_Dâ was not declared in this scope
./Communicator.h:39: error: expected initializer before â*â token
./Communicator.h:48: error: âzvalâ has not been declared
./Communicator.h:49: error: âTSRMLS_Dâ has not been declared
./Communicator.h:50: error: âTSRMLS_Dâ has not been declared
In file included from Communicator.cpp:11:
./Logger.h:18: error: âTSRMLS_Dâ was not declared in this scope
./Logger.h:20: error: âzvalâ was not declared in this scope
./Logger.h:20: error: expected primary-expression before â,â token
./Logger.h:20: error: expected primary-expression before âconstâ
./Logger.h:20: error: initializer expression list treated as compound expression
./Logger.h:21: error: âzvalâ was not declared in this scope
./Logger.h:21: error: expected primary-expression before â,â token
./Logger.h:21: error: expected primary-expression before â&â token
./Logger.h:21: error: âTSRMLS_DCâ was not declared in this scope
./Logger.h:21: error: initializer expression list treated as compound expression
./Logger.h:26: error: expected initializer before â*â token
In file included from Communicator.cpp:12:
./Properties.h:20: error: expected constructor, destructor, or type conversion before â(â token
./Properties.h:26: error: âTSRMLS_Dâ was not declared in this scope
./Properties.h:28: error: âzvalâ was not declared in this scope
./Properties.h:28: error: expected primary-expression before â,â token

Comments

  • xdm
    xdm La Coruña, Spain
    Seems you are missing the php-devel package
  • xdm wrote: »
    Seems you are missing the php-devel package

    I think there may have been a dependency issue when trying to pull in that package from the yum repository. Just to confirm, I need the php-devel package to compile IcePHP from the source package, correct? The only way to get the IcePHP for PHP 5.4.35 is via this method is what I read someplace.
  • xdm
    xdm La Coruña, Spain
    to build Ice for PHP you need php-devel installed
  • I have installed ice-php-devel package via yum and when I went to try and run "make" within the Ice-3.5.1/php folder I received the following errors:
    root@web [/home/Ice-3.5.1/php]# make
    making all in src
    make[1]: Entering directory `/home/Ice-3.5.1/php/src'
    making all in IcePHP
    make[2]: Entering directory `/home/Ice-3.5.1/php/src/IcePHP'
    make[2]: *** No rule to make target `../../../cpp/include/Ice/CommunicatorF.h', needed by `Communicator.o'.  Stop.
    make[2]: Leaving directory `/home/Ice-3.5.1/php/src/IcePHP'
    make[1]: *** [all] Error 1
    make[1]: Leaving directory `/home/Ice-3.5.1/php/src'
    make: *** [all] Error 1
    

    I did see the following in the instructions on your website but I have no idea where Ice is installed to via yum:
    If you have not built Ice for C++ from the cpp subdirectory, then set the ICE_HOME environment variable to the directory containing your Ice installation. For example, if Ice is installed in /opt/Ice-3.5.1, set ICE_HOME as follows:
    $ export ICE_HOME=/opt/Ice-3.5.1
    If you installed Ice using RPMs, set ICE_HOME as shown below:
    $ export ICE_HOME=/usr

    I also did
    export ICE_HOME=/usr
    
    and that didn't work, received the following error:
    make[2]: *** No rule to make target `/usr/include/Ice/Ice.h', needed by `Communicator.o'.  Stop.
    

    !! EDIT (SOLVED) !! - I saw in the documentation something about C++ from the cpp/ directory when compiling from source so I just randomly installed the ice-c++-devel package since I wasn't sure if that was it and it worked!! Thanks for the help, much appreciated!!
  • I have a new issue now... I can't seem to get the IcePHP.so extension to load with PHP. I am running PHP 5.4.35 and I compiled ice-php from Ice 3.5.1 source tar.gz as noted by an zeroc staff member in another thread since your ice-php is compiled against PHP 5.3.x

    I have the IcePHP.so file in my PHP extensions directory and I have extension=IcePHP.so in my php.ini

    Any suggestions? Thank you!
  • mes
    mes California
    A few suggestions:
    • Check the permissions of IcePHP.so in your extension directory to make sure it's readable by the user that runs the web server
    • Run ldd IcePHP.so and make sure the output is reasonable (i.e., that the dependent libraries like libIce are being found in the correct locations)
    • Create a file in the web server document directory containing this code:
      <?php
      phpInfo();
      ?>
      Then open it in your browser and review the output. Make sure to check settings like the extension directory. When the IcePHP extension is successfully loaded, there will be an "ice" section in this output.

    Mark
  • i ran the command and everything looks ok to me
    root@web [/home/Ice-3.5.1/php/lib]# ldd IcePHP.so
            linux-vdso.so.1 =>  (0x00007fff709d2000)
            libIce.so.35 => /usr/lib64/libIce.so.35 (0x00007f79c167a000)
            libSlice.so.35 => /usr/lib64/libSlice.so.35 (0x00007f79c12ba000)
            libIceUtil.so.35 => /usr/lib64/libIceUtil.so.35 (0x00007f79c107a000)
            libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f79c0d74000)
            libm.so.6 => /lib64/libm.so.6 (0x00007f79c0aef000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f79c08d9000)
            libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f79c06bc000)
            libc.so.6 => /lib64/libc.so.6 (0x00007f79c0327000)
            libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f79c0116000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00007f79bff12000)
            librt.so.1 => /lib64/librt.so.1 (0x00007f79bfd09000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f79c1f84000)
    

    everything looks ok with the phpinfo include dir, etc.
  • mes
    mes California
    If the extension still isn't loading, I would start by trying to keep it really simple:

    % cd /home/Ice-3.5.1/php/lib
    % cat > tmp.ini
    extension_dir=.
    extension=IcePHP.so
    ^D
    % php -n -c tmp.ini -m

    Is the ice module listed in the output? If not, please show the output.

    Mark
  • I did find an error_log file created in my php extensions directory with the following output
    [21-Nov-2014 16:07:21 America/Chicago] PHP Warning:  PHP Startup: ice: Unable to initialize module
    Module compiled with module API=20090626
    PHP    compiled with module API=20100525
    These options need to match
     in Unknown on line 0
    
  • mes wrote: »
    If the extension still isn't loading, I would start by trying to keep it really simple:

    % cd /home/Ice-3.5.1/php/lib
    % cat > tmp.ini
    extension_dir=.
    extension=IcePHP.so
    ^D
    % php -n -c tmp.ini -m

    Is the ice module listed in the output? If not, please show the output.

    Mark

    Here is the output:
    [PHP Modules]
    bcmath
    calendar
    cgi-fcgi
    Core
    ctype
    curl
    date
    dom
    ereg
    filter
    ftp
    hash
    iconv
    imap
    json
    libxml
    mbstring
    mcrypt
    mysql
    mysqlnd
    openssl
    pcre
    Phar
    posix
    Reflection
    session
    SimpleXML
    sockets
    SPL
    sqlite3
    standard
    tokenizer
    xml
    xmlreader
    xmlwriter
    zlib
    
    [Zend Modules]
    

    EDIT: I'm not sure if it matters but I tried to compile PHP with both the default Make.rules.php config and by modifying the PHP_HOME to /usr/local
  • mes
    mes California
    Your web server is probably loading the older version of the PHP module, and that module is complaining about trying to load the IcePHP extension that was built against a newer version of PHP. You'll need to update the web server configuration so that it loads the PHP 5.4.35 module instead. Start by looking at the files included in the php RPM:

    $ rpm -ql php | more
    /etc/httpd/conf.d/php.conf
    /etc/httpd/conf.modules.d/10-php.conf
    /usr/lib64/httpd/modules/libphp5.so
    /usr/share/httpd/icons/php.gif
    /var/lib/php/session

    The file libphp5.so is the PHP module.

    Mark
  • Thanks for the help so far guys, I really appreciate it!

    When I run that command I get the following:
    /etc/httpd/conf.d/php.conf
    /usr/lib64/httpd/modules/libphp5.so
    /var/lib/php/session
    /var/www/icons/php.gif
    

    I just recompiled apache/php using easyapache for cPanel so I am not sure what else to do in regards to instructing the web server configuration to use the correct module(s).
  • In Cpanel, when I look at the PHP configuration editor... I see the following:

    extension = pdo.so, pdo_sqlite.so, pdo_mysql.so, IcePHP.so
    extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20100525

    That directory is where I put the newly compiled IcePHP.so as I replaced the old one. I think this is what you mean as far as the web server configuration goes but maybe not?
  • I GOT IT WORKING!!

    1) Removed the php extension directories and recompiled apache/PHP
    2) Rebooted the machine.
    3) I removed the Ice-3.5.1 source folder and extracted a fresh copy
    4) Setup the PHP_HOME and ICE_HOME in configs/export
    5) Recompiled Ice PHP to get a new IcePHP.so, tossed it in the extensions folder and bam, shows up now with php -m | grep ice

    Thank you all for your help and guidance, it was very much appreciated!