Okay, so after some research I figured it out. The php.exe process is 32 bits. The COM-visible assembly is compiled for any CPU, so it should be available for both 32-bit and 64-bit applications.
The problem is that on a 64-bit OS php.exe and any 32-bit process searches the HKEY_CLASSES_ROOT \ Wow6432Node \ CLSID instead of HKEY_CLASSES_ROOT \ CLSID in the HKEY_LOCAL_MACHINE \ Software \ Classes \ Wow6432Node \ CLSID instead of the HKEY_LOCAL_MACHINE \ Software \ Classes \ CLSID The registry entries in the Wow6432 keys are not created by the regasm that ships with the .NET framework v4 on Windows Server 2008. They are created in Windows 7, do not ask me why.
It also turned out that if I create a small test assembly for .NET v2.0 and register it with regasm, which comes with the .NET framework v2.0, it creates Wow6432Node entries in Windows 2008. It's strange.
So my solution is to create the main registry file on the server using:
regasm /regfile MyClassLib.dll
This creates the MyClassLib.reg file with only βnormalβ 64-bit entries. Then I exported the Wow6432Node keys from a Windows 7 computer and added it to this .reg file. Now, when I import this reg file into the Windows 2008 registry, everything works fine.
For more information about Wow6432Node entries, follow these steps: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724072%28v=vs.85%29.aspx
Hope this saves someone else some time and headaches.
source share