Hi,
I wonder if anyone can help with this (sorry if its been asked before) - I have an Apache server running on a windows 2000 server with PHP 4.3.3 Installed. I'm trying to execute the following bit of script (PHP) on the server:
<?php
exec("registry", $results2);
foreach ($results2 as $x)
{
print $x . "<br>";
}
?>
which executes a test program called registry.exe written in VC++ - a console application which prints a string from the registry to the standard output for PHP to pick up.
From a command line normally (just starting a shell) - the test program(VC++) executes successfully and returns the required key to the standard output.
From within apache/php2 - when the test program is executed
I always get back that RegOpenKey() fails with the system error message "The system cannot find the file specified" when trying to access the key I'm trying to open : HKEY_CURRENT_USER\Software\Synectics\PSNIngest\Device\NPF_{BA492337-5CFC-442C-AFE1-3DBFF5F59E60} (which is a key which does exist)
Any ideas as to why the test program differs in the results it returns under php/apache as opposed to just running it from a command line ?
Thanks,
Phil
Hmm... I cured this about 30mins after posting it - the answer is of course in the service manager - with Apache set to run as administrator the utility works and I can now get at the registry to have my wicked way :-)