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

search for in the

win32_set_service_status> <win32_pause_service
[edit] Last updated: Fri, 25 May 2012

view this page in

win32_query_service_status

(PECL win32service SVN)

win32_query_service_statusサービスの状態を問い合わせる

説明

mixed win32_query_service_status ( string $servicename [, string $machine ] )

サービスの稼動状況を問い合わせ、情報を配列で返します。

パラメータ

servicename

サービスの短い名前。

machine

オプションのマシン名。指定しなかった場合、ローカルマシンが使用されます。

返り値

成功した場合に以下の情報を含む配列を返します。パラメータに問題がある場合は FALSE、失敗した場合は Win32 エラーコード を返します。

ServiceType

dwServiceType Win32Service サービス型のビットマスク を参照ください。

CurrentState

dwCurrentState Win32Service サービスステータス定数 を参照ください。

ControlsAccepted

サービスが許可しているコントロール。 Win32Service サービス制御メッセージが受領されたときのビットマスク を参照ください。

Win32ExitCode

サービスが終了した際にプロセスが返すコード。

ServiceSpecificExitCode

サービスが異常終了した際にイベントログに記録されるコード。

CheckPoint

サービスが終了する際に、現在のチェックポイント番号を保持します。 SCM はこれをいわゆる心拍のように扱い、反応しなくなったサービスを 検出するために使用します。この値は、WaitHint の値と組み合わせて 用いられます。

WaitHint

サービスが終了する際に、WaitHint を checkpoint の値に設定します。 この処理が終了した時点でサービスの終了処理が 100% 完了したことを示します。 これは、進捗状況のインジケータを実装する際に使用します。

ProcessId

Windows のプロセス ID 。0 の場合、プロセスは実行していません。

ServiceFlags

dwServiceFlags Win32Service サービスフラグ定数 を参照ください。



win32_set_service_status> <win32_pause_service
[edit] Last updated: Fri, 25 May 2012
 
add a note add a note User Contributed Notes win32_query_service_status
demers dot alex at gmail dot com 21-Jul-2009 08:39
This function will return an array containing the above information as a return value, but if this fails it will return an integer which is a System Error Code. All the System Error Codes can be found here:

http://msdn.microsoft.com/en-us/library/ms681381%28VS.85%29.aspx

In my case, it returned 5, in which I immediately knew why and fixed the issue right away.

In the case of mnemotronic at netscape dot net, here in the documentation notes, it returned 1060 which is:

ERROR_SERVICE_DOES_NOT_EXIST
1060 (0x424)
The specified service does not exist as an installed service.

Again, it should not return FALSE, instead an System Error Code for Windows.
CM at chaosmixed dot com 16-Jun-2009 10:29
***Notice the name is IISADMIN and not IIS Admin
right click the serivce then, type in the "Service Name" not the "Display Name" or you will get 1060

<?php
$servicename
="IISADMIN";
$machine ="desktopper";
//print_r (win32_query_Service_status($servicename,$machine));

echo  $servicename;

$sray = win32_query_Service_status($servicename,$machine);

echo
"<br>";

print_r ($sray);

echo
"<ul>";
echo
"<li>Service Type: " .$sray[ServiceType] . "</li>";
echo
"<li>CurrentState: " .$sray[CurrentState] . "</li>";
echo
"<li>Controls Accpeted: " .$sray[ControlsAccepted] . "</li>";
echo
"<li>Win32 Exit Code: " .$sray[Win32ExitCode] . "</li>";
echo
"<li>Service Specific Exit Code: " .$sray[ServiceSpecificExitCode] . "</li>";
echo
"<li>Check Point: " .$sray[CheckPoint] . "</li>";
echo
"<li>Wait Hint: " .$sray[WaitHint] . "</li>";
echo
"<li>Process Id: " .$sray[ProcessId] . "</li>";
echo
"<li>Service Flags: " .$sray[ServiceFlags] . "</li>";
?>
mnemotronic at netscape dot net 25-Oct-2006 07:30
If the service specified is non-existant, "win32_query_service_status" seems to return an integer, not  the expected FALSE value:

<?php
$svcStatus
=win32_query_service_status ('_bogons_');
echo
$svcStatus ;
?>

prints 1060

-- This is for xampp PHP; v5.1.6

 
show source | credits | stats | sitemap | contact | advertising | mirror sites