Can you create a Windows service with Phalanger?
Posted: May 14th, 2014, 8:20 am
Hello,
I'm trying out Phalanger and so far it looks quite interesting. When I attempted to create a Windows Service I ran into an obstacle that I couldn't overcome.
I created a simple dummy service which I was able to install using sc.exe, however when I try to start it, the service fails with the error 1053: The service did not respond to the start or control request in a timely fashion.
The event log also shows this error:
A timeout was reached (30000 milliseconds) while waiting for the DummyService service to connect.
Here's my code:
What am I missing?
I'm trying out Phalanger and so far it looks quite interesting. When I attempted to create a Windows Service I ran into an obstacle that I couldn't overcome.
I created a simple dummy service which I was able to install using sc.exe, however when I try to start it, the service fails with the error 1053: The service did not respond to the start or control request in a timely fashion.
The event log also shows this error:
A timeout was reached (30000 milliseconds) while waiting for the DummyService service to connect.
Here's my code:
- Code: Select all
<?php
use System;
use System\ServiceProcess;
class DummyService extends System\ServiceProcess\ServiceBase {
public function DummyService() {
$this->ServiceName = "DummyService";
$this->CanStop = true;
$this->CanPauseAndContinue = true;
$this->AutoLog = true;
}
public function Main() {
System\ServiceProcess\ServiceBase\Run(new DummyService());
}
protected function OnStart($args) {
parent::OnStart($args);
}
protected function OnStop() {
parent::OnStop();
}
}
What am I missing?