I am attempting to research and implement creating windows services via php using the PECL extension "extension=php_win32service.dll". The call itself is working fine as far as I know because I don't get a unknown function call when calling win32_create_service(). However the problem I am having is that no matter what machine (remote or local) I try to register the service on , I get a win32 error code 5 (Access Denied).
Code: Select all
<?php
$x = win32_create_service( array(
'service' => 'SERVNAME',
'display' => 'Test PHP Service',
'path' => 'C:\\path_to_executable_on_192.168.0.101\\executable.exe',
'params' => 'param1 param2 .... paramn'
)
, '192.168.0.101'
);
// Always returns access denied
echo "Win32 error: $x";
?>
Any assistance would be greatly appreciated.
Cheers