PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

win32service 関数> <定義済み定数
Last updated: Fri, 05 Sep 2008

view this page in

例1 PHP スクリプトをサービスとして登録する

<?php
win32_create_service
(array(
    
'service' => 'dummyphp',                 # サービスの名前
    
'display' => 'sample dummy PHP service'# 説明
    
'params' => 'c:\path\to\script.php run'# スクリプトへのパスとパラメータ
));
?>

例2 サービスの登録を解除する

<?php
win32_delete_service
('dummyphp');
?>

例3 サービスとして実行する

<?php
if ($argv[1] == 'run') {
  
win32_start_service_ctrl_dispatcher('dummyphp');

  while (
WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) {
    
# ここに実際の作業内容を書きます。
    # 1 回のループに 30 秒以上かからないように心がけてください。
  
}
}
?>



add a note add a note User Contributed Notes
There are no user contributed notes for this page.

win32service 関数> <定義済み定数
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites