Archived

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

Problems with installation of IcePHP

Hello, I'm trying to use Ice with PHP5 but I don't have the sources of PHP, only de binaries because I have installed it using apt-get install(do you know it?) in Linux.Is this possible?I use apache2 with PHP5,I make a proof and Ice is not detected, this message is shown:
Fatal error: Call to undefined function: ice_loadprofile() in /var/www/drupal-4.7.0/modules/can.module on line 20

Can you help me?

Thanks

Comments

  • mes
    mes California
    Hi,

    Did you modify your PHP configuration to install the IcePHP extension?

    When asking for help, please always specify the exact version of Ice, Linux, and PHP you are using. It would also be helpful for us to know whether you're using a binary Ice distribution, or whether you built Ice from sources.

    Take care,
    - Mark
  • Hi again

    Hi,
    I'm using IcePHP 3.0.1,PHP5,Apache2 (for Drupal 4.7 to make web-pages) and Debian 2.6.16. I haven't modified PHP configuration because I have downloaded Ice PHP using apt-get-install, and (in theory) it configurated the system automatically. Ho can I solve it?

    Thanks
  • mes
    mes California
    I'm not familiar with the Debian installation process, but the error message you reported indicates that the IcePHP extension is not installed, so I suspect that you still have some configuration work to do.

    You'll need to edit PHP's configuration file (php.ini) and add the following directives:

    extension_dir = <ICE_HOME>/lib
    extension = icephp.so

    Replace <ICE_HOME> with the Ice installation directory. If there is another occurrence of extension_dir in php.ini, you should comment it out (assuming you don't need it).

    Also note that icephp.so depends on Ice libraries such as libIce, libSlice and libIceUtil.

    Take care,
    - Mark
  • Thanks, but new problems

    Thanks a lot!!Now I have installed IcePHP

    I have read the manual and I don't understand some things. I am using Drupal.Drupal is software that allows an individual or a community of users to easily publish, manage and organize a great variety of content on a website. It works loading several modules developed in php5, all this modules are in the same directory. I have to create new modules using PHP5 and Ice. Where I have to put the file .ice?In the same directory of the modules?

    New doubts, where I have to put the PHP configuration directive for the default profile?Is necessary?

    Thanks
  • mes
    mes California
    cesartovic wrote:
    Where I have to put the file .ice? In the same directory of the modules?
    The default directory is usually the Apache server's default directory. I recommend using an absolute path instead, for example:

    ice.slice=/home/cesartovic/file.ice

    Note that the Apache server must be able to access the file.
    New doubts, where I have to put the PHP configuration directive for the default profile? Is necessary?
    The IcePHP configuration directives must be added to php.ini. The location of php.ini varies; check your PHP5 package for details.

    - Mark
  • problems again

    I think that I have put all the things correct in php.ini but when I use IcePHP in the module tis message error is thrown:

    Fatal error: Call to a member function stringToProxy() on a non-object in /var/www/drupal-4.7.0/modules/ejemplo_ice/ejemplo_ice.module on line 36

    This is the code:

    Ice_loadProfile();
    $p = $ICE->stringToProxy("gestorsubun:tcp -h 138.4.9.76 -p 10025");
    $subs = $p->ice_checkedCast("::Management::GestorSubUn");
    $subs->subscribe("incidencias","138.4.9.76");

    What is the problem?

    Thanks
  • mes
    mes California
    You probably need to add this to your code:

    global $ICE;

    - Mark
  • OK, this problem is fixed but another appears:P
    I think that is because the slice don't works well because problem configuration. This is the error:

    atal error: Ice_ObjectPrx::ice_checkedCast() [<a href='function.ice-checkedCast'>function.ice-checkedCast</a>]: no Slice definition found for type Management::GestorSubUn

    This is GestorSubUn.ice:

    #ifndef GESTORSUBUN_ICE
    #define GESTORSUBUN_ICE


    module Management{

    interface GestorSubUn{

    int subscribe(string topic, string host);
    int unsubscribe(string topic, string host);
    };
    };


    #endif

    and the code is the same.

    Thanks a lot, is my first use of IcePHP, I thinks that inthe future I will solve my problems alone;)
  • mes
    mes California
    cesartovic wrote:
    I think that is because the slice don't works well because problem configuration.
    Yes, this looks like a configuration problem (your Slice file is not being loaded).

    Take care,
    - Mark
  • Hi again
    If I put in php.ini

    ice.slice=/var/www/drupal-4.7.0/modules/ejemplo_ice/GestorSubUn.ice

    this problemis shown in Mozilla:

    Unable to connect

    Firefox can't establish a connection to the server at localhost

    * The site could be temporarily unavailable or too busy. Try again in a few
    moments.

    * If you are unable to load any pages, check your computer's network
    connection.

    * If your computer or network is protected by a firewall or proxy, make sure
    that Firefox is permitted to access the Web.

    and if I put

    Ice.slice=/var/www/drupal-4.7.0/modules/ejemplo_ice/GestorSubUn.ice

    mozilla works but the other error about not Slice is shown.

    What so you think?

    Thanks and sorry
  • mes
    mes California
    If IcePHP fails while attempting to load your Slice file, PHP may not start correctly and therefore Apache may not start.

    The Ice.slice directive is ignored because it is not spelled correctly; it must be ice.slice. The fact that Apache starts when using Ice.slice but not when using ice.slice means IcePHP is having trouble loading your Slice file.

    The first step is to check the permissions on GestorSubUn.ice to verify that they are accessible to the user id of the Apache server. You must also verify that the server can access all of the intermediate subdirectories.

    Next, IcePHP must be able to use icecpp (the Slice preprocessor), therefore $ICE_HOME/bin should be in the Apache server's PATH.

    Hope that helps,
    - Mark
  • Apache 2

    Hi again
    I'm using apache2 and ice.so ,like in the example demo/value php.ini says:

    Furthermore, if you built the dynamic Ice extension from source,
    ; replace "icephp.so" in the second line with "ice.so".

    there is no problem with it no?

    Thanks
  • mes
    mes California
    You can rename ice.so to icephp.so if you like, but it should not cause a problem.

    - Mark
  • Apache2

    Hi again!!

    Have you make tests with Apache2 and Ice?Where is the Apache2 PATH?The slice commands (icecpp...) are recognised in all of the directories oso the PATH is well configured no?

    I'm desperated!!:(

    Thanks a lot
  • mes
    mes California
    Hi,

    We have tested Apache2 and IcePHP successfully on Linux.

    It's important to understand the relationship between Apache, PHP and IcePHP. Apache runs as a process under a particular user account (such as apache or nobody), which means PHP and IcePHP operate with this user's environment and access privileges. Apache loads PHP as a module. Depending on your configuration, IcePHP is either compiled statically into PHP, or is loaded dynamically by PHP as an extension.

    IcePHP has dependencies on Ice shared libraries. You can use the ldd command to verify these dependencies. Furthermore, in order to load Slice files, IcePHP needs to execute the icecpp binary, which means icecpp needs to be in the PATH configured for the user that is running the Apache executable.

    As a temporary solution, you could copy the icecpp executable into a common directory, such as /bin, to determine whether that is the cause of the problem. Similarly, you could also copy your Slice files to a public directory such as /tmp to verify that access permissions are not causing a problem.

    You should also check the Apache error logs to see if they contain any useful information.

    Hope that helps,
    - Mark
  • Hi,
    I have followed this thread to use IcePHP. I am also working with drupal, apache2 and php5, with a debian distribution and a 2.6.18 kernel.
    My problem is that after following all the steps, I get this message when I try to use a module with Ice:
    Fatal error: Call to undefined function Ice_loadProfile() in
    /var/www/drupal-5.1/sites/default/modules/maquina/maquina.module on line 43
    
    Searching in the logs files I have found that the ice module was not initialize as you can see:
    PHP Warning:  PHP Startup: ice: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
    

    Do you know how can I solve it?

    Thanks for your help
  • mes
    mes California
    It looks like you are using incompatible versions of PHP and IcePHP. If you are using a binary distribution of Ice, you must verify that you have installed the version of PHP required by IcePHP. If you cannot change your PHP installation, then I recommend that you build the IcePHP source distribution using your existing PHP version.

    Take care,
    - Mark