Hello...OK, here is the story: The DLL is part of a software security (anti-cracking) package I purchased about 9 years ago. It has since been discontinued by the creator, and I cannot find the creator (from Singapore). But I still use this package and it still works well. I have never used the DLL before until now (I have always only used the stand-alone EXE version right on my PC). Anyway, according to the documentation I have on how to run the DLL from PHP on a Windows Server with IIS (...whatever that means), the author gives this example code:
<?php $objKG = new COM("CodeLockKeyGen.KeyGen"); $result = $objKG->Get_RegistrationCode("12345678", "ED3E78BDB99C15A36DB6746B9966B6ECCFF62E8202EEB9956DC83B7F15C4AF00", "ChosenBytes", "RegFile - ChosenBytes.txt", True); echo $result; ?>
Please keep in mind I know next to nothing about PHP and COM, but this script looks simple enough. The DLL accepts a few strings and as output it generates an activation code. So I have made a very "bare-bones" php file with just that code to try this. When I run it, it returns with:
"The page cannot be displayed because an internal server error has occurred."
My first question, and probably a stupid one is: why isn't the name of my DLL file (Code-Lock Keygen.DLL) not declared anywhere in the PHP code? This is one thing I don't understand, and maybe it's part of the problem? I just don't understand how the PHP script can call this DLL, if it doesn't know the full name of the DLL file.
Secondly, I don't understand about this line in the script:
$objKG = new COM("CodeLockKeyGen.KeyGen
... I ran another software on the DLL that gives the name of the internal libraries within the DLL, and it said the library name is "CodeLockKeyGen". So why would this PHP command say : new COM("CodeLockKeyGen.KeyGen
") ? Why is there that extra ".KeyGen"?
Now trying to get good answers from my webhost is just about impossible. I won't give their name, but they are incompetent.... they know nothing. i asked them several times "is everything ok on your end to run DLL's/COM objects". They said yes. Then after about an hour of wrangling with them, they finally cough up the tidbit that my DLL has to be in the BIN folder. I didn't know that... how was I to know that. There was no BIN folder, but there was a cgi-bin folder, so we moved my DLL file in there. Same result, same error.
After more back and forth with no success... the whole time them saying it's the fault of my code, I discovered over google that maybe they were missing something else -->
" If you are seeing this in your error log:
Fatal error: Class 'COM' not found
You require this in php.ini:
... so I asked them to put that in their php.ini. The tech support person didn't even know what a php.ini file was or where to find it. So after they got that set up, I tried to run it again, and still same error.
Can someone, SOME kind soul maybe take a look at the simple PHP script I outlined above and see where the code may be incorrect? Or what is lacking on the server side to do this?
This is just driving me nuts.