win32_create_service

(PECL win32service SVN)
Creates a new service entry in the SCM database
mixed win32_create_service ( array $details [, string $machine ] )
Parameters:
details

An array of service details:

machine

The optional machine name on which you want to create a service. If omitted, it will use the local machine.

Returns:

Returns WIN32_NO_ERROR on success, FALSE if there is a problem with the parameters or a Win32 Error Code on failure.

Examples:
A win32_create_service() example

Create a service with the short name 'dummyphp'.

<?php
$x = win32_create_service(array(
    'service'     => 'dummyphp',                                           # the name of your service
    'display'     => 'sample dummy PHP service',                           # short description
    'description' => 'This is a dummy Windows service created using PHP.', # long description
    'params'      => '"' . __FILE__ . '"  run',                            # path to the script and parameters
));
debug_zval_dump($x);
?>

See also:

win32_delete_service() -

Win32 Base Priority Classes -

Win32 Error Codes -

doc_php
2016-02-24 16:14:30
Comments
Leave a Comment

Please login to continue.