<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >win32_create_service</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="win32service Functions" HREF="ref.win32service.html"><LINK REL="PREVIOUS" TITLE="win32service Functions" HREF="ref.win32service.html"><LINK REL="NEXT" TITLE="win32_delete_service" HREF="function.win32-delete-service.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="ref.win32service.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.win32-delete-service.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.win32-create-service" ></A >win32_create_service</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN232212" ></A ><P > (PECL)</P >win32_create_service -- Creates a new service entry in the SCM database</DIV ><DIV CLASS="refsect1" ><A NAME="AEN232215" ></A ><H2 >Descrição</H2 >int <B CLASS="methodname" >win32_create_service</B > ( array details [, string machine] )<BR ></BR ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN232226" ></A ><H2 >Parâmetros</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >details</CODE ></DT ><DD ><P > An array of service details: <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >service</CODE ></DT ><DD ><P > The short name of the service. This is the name that you will use to control the service using the <TT CLASS="literal" >net</TT > command. The service must be unique (no two services can share the same name), and, ideally, should avoid having spaces in the name. </P ></DD ><DT ><CODE CLASS="parameter" >display</CODE ></DT ><DD ><P >The display name of the service. This is the name that you will see in the Services Applet. </P ></DD ><DT ><CODE CLASS="parameter" >user</CODE ></DT ><DD ><P > The name of the user account under which you want the service to run. If omitted, the service will run as the LocalSystem account. If the username is specified, you must also provide a password. </P ></DD ><DT ><CODE CLASS="parameter" >password</CODE ></DT ><DD ><P > The password that corresponds to the <CODE CLASS="parameter" >user</CODE >. </P ></DD ><DT ><CODE CLASS="parameter" >path</CODE ></DT ><DD ><P > The full path to the executable module that will be launched when the service is started. If omitted, the path to the current PHP process will be used. </P ></DD ><DT ><CODE CLASS="parameter" >params</CODE ></DT ><DD ><P > Command line parameters to pass to the service when it starts. If you want to run a PHP script as the service, then the first parameter should be the full path to the PHP script that you intend to run. </P ></DD ><DT ><CODE CLASS="parameter" >load_order</CODE ></DT ><DD ><P > Controls the load_order. This is not yet fully supported. </P ></DD ><DT ><CODE CLASS="parameter" >svc_type</CODE ></DT ><DD ><P > Sets the service type. If omitted, the default value is <TT CLASS="constant" ><B >WIN32_SERVICE_WIN32_OWN_PROCESS</B ></TT >. Don't change this unless you know what you're doing. </P ></DD ><DT ><CODE CLASS="parameter" >start_type</CODE ></DT ><DD ><P > Specifies how the service should be started. The default is <TT CLASS="constant" ><B >WIN32_SERVICE_AUTO_START</B ></TT > which means the the service will be launched when the machine starts up. </P ></DD ><DT ><CODE CLASS="parameter" >error_control</CODE ></DT ><DD ><P > Informs the SCM what it should do when it detects a problem with the service. The default is <TT CLASS="constant" ><B >WIN32_SERVER_ERROR_IGNORE</B ></TT >. Changing this value is not yet fully supported. </P ></DD ></DL ></DIV > </P ></DD ><DT ><CODE CLASS="parameter" >machine</CODE ></DT ><DD ><P > The optional machine name on which you want to create a service. If omitted, it will use the local machine. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN232296" ></A ><H2 >Valores de retornado</H2 ><P > Returns <TT CLASS="constant" ><B >TRUE</B ></TT > on success, otherwise returns a win32 error code. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN232300" ></A ><H2 >Exemplos</H2 ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN232303" ></A ><P ><B >Exemplo 1. A <B CLASS="function" >win32_create_service()</B > example</B ></P ><P > Any text that describes the purpose of the example, or what goes on in the example should go here (inside the <TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br />$x </font><font color="#007700">= </font><font color="#0000BB">win32_create_service</font><font color="#007700">(array(<br /> </font><font color="#DD0000">'service' </font><font color="#007700">=> </font><font color="#DD0000">'dummyphp'</font><font color="#007700">,<br /> </font><font color="#DD0000">'display' </font><font color="#007700">=> </font><font color="#DD0000">'sample dummy PHP service'</font><font color="#007700">,<br /> </font><font color="#DD0000">'params' </font><font color="#007700">=> </font><font color="#0000BB">__FILE__ </font><font color="#007700">. </font><font color="#DD0000">' run'</font><font color="#007700">,<br />));<br /></font><font color="#0000BB">debug_zval_dump</font><font color="#007700">(</font><font color="#0000BB">$x</font><font color="#007700">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE > </P ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN232308" ></A ><H2 >Veja também</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.win32-delete-service.html" ><B CLASS="function" >win32_delete_service()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="ref.win32service.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.win32-delete-service.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >win32service Functions</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.win32service.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >win32_delete_service</TD ></TR ></TABLE ></DIV ></BODY ></HTML >