1

I am trying to use COM function in PHP but I am not sure what am I doing wrong. This is my first line in PHP script

$UOSession = new COM("UniObjects.Unioiafctrl") or die("Cant instantiate UO");

I did use regsvr32 to register uniobjects.dll and it was successful, but problem is that if I have any code before this line it executes, any code after this line doesn't work and I don't even get any message was dll successfully instantiated or no. I would assume that if its not instantiated I would get message "Cant instantiate UO" but I don't get any message. That would meant that it was successful, but code stops right there... Does anybody knows what am I doing wrong?

Windows Server 2008 R2 x64, IIS7, PHP 5.3

NeerPatel
  • 863
  • 6
  • 19
zuboje
  • 696
  • 3
  • 11
  • 28
  • I'm having the same problem and was going to create another question, when I found this one. – NeerPatel Dec 12 '13 at 23:32
  • A few differences, I'm using Apache instead and PHP 5.4... but same issue. I even unregistered it and tested it [ScreenShot 2](http://screencast.com/t/l1Q9sMxdw) - Then redid it [ScreenShot 1](http://screencast.com/t/vsrv5mpZpN) ... Still no luck. My Code - `` – NeerPatel Dec 12 '13 at 23:45
  • The key to solving this is which version of PHP you are running. If you are using a 32bit PHP, then UniObject COM will work. If you are using a 64bit version of PHP, then UniObjects COM will not work. UniObjects COM is 32bit only. – International Spectrum Dec 13 '13 at 17:43

1 Answers1

0

Zuboje,

Figured out the issue, with the help of International Spectrum Editor Nathan Rector. Download 32bit version of PHP and use it. You probably have a 64bit version of PHP and it wont be able to read your 32bit COM Object. I was able to install a 32bit version of WAMP and it resolved my issue.

NeerPatel
  • 863
  • 6
  • 19
  • You may also be interested in the following article. It talks about a few other issues regarding 64bit servers and using '!' and 'sh' from TCL. http://www.intl-spectrum.com/resource/106/Shelling-to-run-an-OS-command-from-Windows-64Bit-from-UniVerse.aspx – International Spectrum Dec 13 '13 at 17:46