Can you create a Windows service with Phalanger?
2 posts
• Page 1 of 1
Can you create a Windows service with Phalanger?
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?
- Marko
- Posts: 1
- Joined: May 14th, 2014, 8:14 am
Re: Can you create a Windows service with Phalanger?
Hi,
try to specify [\Export] above the class declaration. This creates .NET like class usable by outer world.
Thanks,
try to specify [\Export] above the class declaration. This creates .NET like class usable by outer world.
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 32 guests