views:

26

answers:

1

I've been trying to create a 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.

A: 

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

Mark Baker
I've already tried that. I've even tried changing the run as user to be the same as the user that's logged on, to no avail.
Jesse