开发者

Access a COM interface from a service (apache) with PHP

开发者 https://www.devze.com 2023-01-10 19:25 出处:网络
I\'ve been trying to create a开发者_如何学Go PHP script which will run on a locally hosted web server, and will be able to access various programs on my computer through COM. I\'ve had mixed success a

I've been trying to create a开发者_如何学Go PHP script which will run on a locally hosted web server, and will be able to access various programs on my computer through COM. I've had mixed success and failure, and I've been able to narrow down the problem.

If I run the php script using php.exe, it works.

If I run the php script using apache running from the command-line, it works.

If I run the php script using apache running as a service, it fails.

I'm running Windows 7 Pro x64, apache 2.2, PHP 5.3, and the particular program I'm trying to access is MediaMonkey, my music player.

Any ideas? If I have to I can just run the server without it being a service, but I would like to figure this out.


Don't have a Windows 7 box to hand, (I'm actually looking at an XP box) but it's likely to be something similar:

  • Pull up the Admin Tools / Services
  • Right click on your Apache Web Server service and select properties.
  • There should be an option here (possibly on the Log On tab) to log on as local system account and "Allow service to interact with desktop"... ensure that it's checked.
  • Save the setting and Restart Apache

Don't know for certain that this is the solution to your problem, but it fixed something similar for me a year or so ago

0

精彩评论

暂无评论...
验证码 换一张
取 消