Just to help a little, the service control command must be in the first script called. If you try to type this portion of code in a separate file and include it, the SCM will not get the controls.
example :
- file1.inc :
<?PHP
class MyClass{
function __construct() {
$x = win32_start_service_ctrl_dispatcher('service');
while (WIN32_SERVICE_CONTROL_STOP!=win32_get_last_control_message()){
//your code
}
}
?>
- service.php :
<?PHP
include("file1.inc");
$object = new MyClass();
?>
WON'T WORK !
win32service 関数
目次
- win32_create_service — SCM データベースに新しいサービスのエントリを作成する
- win32_delete_service — SCM データベースからサービスのエントリを削除する
- win32_get_last_control_message — サービスに送信された直近の制御メッセージを返す
- win32_query_service_status — サービスの状態を問い合わせる
- win32_set_service_status — サービスの状態を更新する
- win32_start_service_ctrl_dispatcher — スクリプトを SCM に登録し、指定した名前でサービスとして稼動させる ようにする
- win32_start_service — サービスを開始する
- win32_stop_service — サービスを停止する
win32service 関数
me at sylvain tiret besse point fr
20-Nov-2007 09:45
20-Nov-2007 09:45
