Archived

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

Unusual PHP Error

Ice 3.4.1 + PHP 5.3.3

I am having an unusual problem. I am receiving the following error, but only in a specific instance and I am trying to narrow down what's causing it:
Fatal error: Uncaught exception 'RuntimeException' with message 'no object found in IcePHP_defineStruct()' in /opt/Ice-3.4.1/php/Ice/Identity.php:44 Stack trace: #0 /opt/Ice-3.4.1/php/Ice/Identity.php(44): IcePHP_defineStruct('::Ice::Identity', 'Ice_Identity', Array) #1 /opt/Ice-3.4.1/php/Ice/LocalException.php(21): require('/opt/Ice-3.4.1/...') #2 /opt/Ice-3.4.1/php/Ice.php(108): require('/opt/Ice-3.4.1/...')

I am running this to interface with Mumble. I have gotten this working with the 3rd party application in all instances except for 1, automation callback when someone makes a payment. The 1 where it doesn't, here is the flow:
1) User makes a payment and a callback file is called, let's call it: callback.php
2) callback.php then runs a method to run the module I have created, let's call that file module.php.

Inside module.php at the top, I have the following:
if (extension_loaded('ice')) {
	require_once 'Ice.php';
	require_once 'Murmur.php';
}
require_once("Mumble_Interface.php");

Inside Mumble_Interface.php is the code to initialize ICE and interface with Mumble server, etc.
$initData = new Ice_InitializationData;
		$initData->properties = Ice_createProperties();
		$initData->properties->setProperty('Ice.ImplicitContext', 'Shared');
		$ICE = Ice_initialize($initData);

		try {
			$proxy = $ICE->stringToProxy('Meta:tcp -h '.$ip.' -p 6502');
			$this->meta = $proxy->ice_checkedCast('::Murmur::Meta')->ice_context($this->secret);
			return TRUE;
		} catch (Ice_ConnectionRefusedException $exc) {
			return "Error: ".$exc;
		}

Any ideas on why this module and Ice/Mumble interface would work when calling directly via the system and not when a payment callback file calls the module? There seems to be no difference in phpinfo() output between working/non-working and no errors on require_once that I can see.

Comments

  • mes
    mes California
    See this thread for a similar discussion.

    Regards,
    Mark
  • mes
    mes California
    Sorry, I forgot to mention that this issue has been fixed in Ice 3.4.2.

    Cheers,
    Mark
  • Hi Mark, thanks for the information!
    I did see that thread before and didn't really think it applied in my situation since it worked in an almost similar situation but wasn't quite sure.

    Thanks for the note about 3.4.2, however I do have an additional question in regards to upgrading. What would be the best way to upgrade 3.4.1 to 3.4.2. I am running RHEL4 (Update 8) so I don't want to break this version of Ice install as it was such a pain in the a$$ to get it working the first time. ;)
  • I just compiled 3.4.2 from source again and changed the path for PHP and all works perfectly now. Thank you very much Mark!