I am running Apache 2.3.16 with PHP 5.3.9. I also have a third party .NET dll that I want to use. I can successfully load the dll using PHP’s DOTNET object, but I am having a problem when I call one of the object’s methods. This is the error message I get:
Source: System.Windows.Forms Description: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
So apparently there is some message or error being generated in the dll that is causing a pop-up box. The problem is that I cannot see that pop-up to know what to do about it. I understand that I am on the client side, and this pop-up is generated on the server, but I still need to know what it is.
Here is what I have tried so far:
- On the Apache service, check “Allow service to interact with desktop”
- Contacting the developer of the dll to see if they know what error might be popping up
- Used the same dll in a simple Windows application to see if I could get an error
None of these approaches has yielded anything. Is there anything else I can try?
Edit:
Per Charles’ idea, I ran the program from php.exe. I tried with the -a option (run interactively) and without, and in both cases the program ran perfectly (no errors, output as expected). So, what could cause it to run correctly from the command prompt but give errors from a client browser?
Thanks to the guys at http://www.apachelounge.com who gave me some direction.
First, I tried running Apache from the console (as opposed to as a Windows service). When I did that, the program worked as expected. This is good, but it is at the very least inconvenient to try to run Apache from the console all the time, because the console has to be open for it to continue running.
So at that point, I tried running Apache as a Windows service, but as a different user than the normal SYSTEM. This did work, so I can now run Apache as a service, and for some unknown (to me, at least) reason the different user made all the difference.