note 64258 deleted from function.iis-add-server by bjori
| From: | bjori@php.net | Date: | Tue, 11 Apr 2006 11:44:20 +0000 |
| Subject: | note 64258 deleted from function.iis-add-server by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107766@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Taken from
http://kromann.info/article.php?Id=11062861865960000
Add a server
iis_add_server() is used to add a new web server to IIS. The function takes 7 parameters that are
used to identify and configure the web server.
$strPath is the physical parth to the document root
$strComment is the text that will show up in the management console
$strIp is the IP address the web server will use
$Port is the port number the web server will listen on
$strHost is the host name
$Rights indicates the access rights
$Status indicates the initial status
<?php
/ $Id: iis_add_server.php,v 1.3 2003/05/22 06:42:26 frank Exp $ /
if (!extension_loaded("iisfunc")) {
dl("php_iisfunc.dll");
}
$strPath = "c:\\inetpub\\new site";
$strComment = "My Install Application";
$strIp = "127.0.0.1";
$Port = 80;
$strHost = "localhost";
$Rights = IIS_READ | IIS_SCRIPT;
$State = IIS_STOPPED; // Or IIS_RUNNING
// Make sure the root directoy exists
if (!is_dir($strPath)) mkdir($strPath);
$ServerInstance = iis_add_server($strPath, $strComment, $strIp, $Port, $strHost, $Rights, $State);
echo "New ServerInstance = $ServerInstance\n";
?>
IIS Constants
The IIS extensions defines a number of constants that makes it easier to read and write PHP scripts.
Constants used to define access rights:
IIS_READ
IIS_WRITE
IIS_EXECUTE
IIS_SCRIPT
Constants used to define the script access:
IIS_ANONYMOUS
IIS_BASIC
IIS_NTLM
Constants used to define server status:
IIS_STARTING
IIS_STOPPED
IIS_PAUSED
IIS_RUNNING