Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-29-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
Configuration problems with PHP

Hello!

I am new with PHP and I am trying to test a simple example of PHP client. I use Debian etch/sid, Apache 2.0, PHP 5.1.4-0.1, and Ice 3.1.0 (using Debian Sid repositories).

I specify the following line in the /etc/php5/apache2/php.ini:

ice.slice=/var/www/test.ice

but when I try to test the simple example (using a web browser), I obtain the following error:

Fatal error: Call to undefined function Ice_loadProfile() in /var/www/test.php on line 12

I have studied the examples included in the IcePHP distribution, but I have not found any difference.

Thank you,
David.
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
  #2 (permalink)  
Old 08-29-2006
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 976
Hi,

The error message indicates that the Ice extension for PHP has not been loaded. Examine your php.ini file to determine the extension directory (defined by the extension_dir directive) and copy icephp.so into that directory. Then you'll need to add the following line to php.ini:

extension = icephp.so

Hope that helps,
- Mark
Reply With Quote
  #3 (permalink)  
Old 08-29-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
Hello,

I installed the Debian package php-zeroc-ice (using the repositories of Debian Sid), but I can't find the icephp.so file in /usr/lib. However, in the /usr/lib/php5/20051025/ directory there is a ice.so file, but it doesn't work if I use it to load the Ice extension for PHP (the Apache2 web server doesn't start).

Some idea?

Thank you,
David.
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
  #4 (permalink)  
Old 08-29-2006
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
I'm afraid you'll have to ask this question the Debian Ice maintainer. The Debian port is not from ZeroC. See http://packages.debian.org/unstable/devel/zeroc-ice.
Reply With Quote
  #5 (permalink)  
Old 08-29-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
Hello again!

I have solved the problem with the Ice extension for PHP, but I have a simple question. Where can I find an example of a PHP script in which I establish a connection with Glacier? Here is the code I have to port using Python:

router = Glacier2.RouterPrx.checkedCast(self.communicator() .getDefaultRouter())
session = router.createSession('user', 'password')

Regards,
David.
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
  #6 (permalink)  
Old 08-29-2006
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 976
Hi,

To access Glacier2 from a PHP script, you'll need to define the Ice.Default.Router property in your IcePHP configuration. You'll also need to load the Glacier2 Slice files. In your script, you can do the following:
Code:
$prop = $ICE->getProperty("Ice.Default.Router");
$router = $ICE->stringToProxy($prop)->ice_checkedCast("::Glacier2::Router");
$session = $router->createSession(...);
Hope that helps,
- Mark
Reply With Quote
  #7 (permalink)  
Old 08-29-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
Sorry for being so insistent, but I can't load the Glacier2 Slice files I need. My php.ini file is the following:

ice.config=/var/www/masyro/agent.cfg
ice.slice=-I/usr/share/slice/Glacier2/Router.ice /var/www/masyro/MASYRO.ice

extension_dir = "/usr/lib/php5/20051025"
extension = ice.so

Apache2 starts correctly (it doesn't show any error in its log file), but when this code is executed

$prop = $ICE->getProperty("Ice.Default.Router");
$router = $ICE->stringToProxy($prop)->ice_checkedCast("::Glacier2::Router");
$session = $router->createSession("user", "password");

I obtain the following error:

no Slice definition found for type ::Glacier2::Router in /var/www/masyro/agentes.php on line 15

I have found a similar example with IcePack, but my example doesn't work by following the same steps. I use Debian etch/sid, Ice 3.1.0, PHP 5, and Apache2.

Thank you again,
David.
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
  #8 (permalink)  
Old 08-29-2006
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 976
You need to do something like this:
Code:
ice.slice=-I/usr/share/slice /usr/share/slice/Glacier2/Router.ice /var/www/masyro/MASYRO.ice
Take care,
- Mark
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting a default configuration file eric.hill Help Center 14 07-03-2008 10:01 AM
problems with VC8.0 stephan Bug Reports 2 07-31-2006 09:39 AM
Plugin configuration kwaclaw Comments 9 09-29-2005 08:07 PM
IcePack and Glacier2 configuration xdm Help Center 4 06-01-2005 12:37 PM
IceStorm example - configuration Bruce Help Center 1 03-18-2004 12:57 PM


All times are GMT -4. The time now is 12:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.