install.windows.iis.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 435 行 · 第 1/2 页
HTML
435 行
do the following: From within the Documents tab, choose Add. Type in <var class="filename">index.php</var> and click OK. Adjust the order by choosing Move Up or Move Down. This is similar to setting DirectoryIndex with Apache. </p> <p class="para"> The steps above must be repeated for each extension that is to be associated with PHP scripts. <i>.php</i> is the most common although <i>.php3</i> may be required for legacy applications. </p> <p class="para"> If you experience 100% CPU usage after some time, turn off the IIS setting <i>Cache ISAPI Application</i>. </p> </div> <div id="install.windows.iis.pws4" class="sect2"> <h3 class="title">Windows and PWS 4</h3> <p class="simpara"> PWS 4 does not support ISAPI, only PHP CGI should be used. </p> <p class="para"> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> Edit the enclosed <var class="filename">pws-php4cgi.reg</var> / <var class="filename">pws-php5cgi.reg</var> file (look into the SAPI folder for PHP 4, or in the main folder for PHP 5) to reflect the location of your <var class="filename">php.exe</var> / <var class="filename">php-cgi.exe</var>. Backslashes should be escaped, for example: <i>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] ".php"="C:\\php\\php.exe"</i> (change to <i>C:\\php\\php-cgi.exe</i> if you are using PHP 5) Now merge this registery file into your system; you may do this by double-clicking it. </span> </li> <li class="listitem"> <span class="simpara"> In the PWS Manager, right click on a given directory you want to add PHP support to, and select Properties. Check the 'Execute' checkbox, and confirm. </span> </li> </ul> </p> </div> <div id="install.windows.iis.iis3" class="sect2"> <h3 class="title">Windows and PWS/IIS 3</h3> <p class="simpara"> The recommended method for configuring these servers is to use the REG file included with the distribution (<var class="filename">pws-php4cgi.reg</var> in the SAPI folder for PHP 4, or <var class="filename">pws-php5cgi.reg</var> in the main folder for PHP 5). You may want to edit this file and make sure the extensions and PHP install directories match your configuration. Or you can follow the steps below to do it manually. </p> <div class="warning"><b class="warning">Warning</b> <p class="para"> These steps involve working directly with the Windows registry. One error here can leave your system in an unstable state. We highly recommend that you back up your registry first. The PHP Development team will not be held responsible if you damage your registry. </p> </div> <p class="para"> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> Run Regedit. </span> </li> <li class="listitem"> <span class="simpara"> Navigate to: <i>HKEY_LOCAL_MACHINE /System /CurrentControlSet /Services /W3Svc /Parameters /ScriptMap</i>. </span> </li> <li class="listitem"> <span class="simpara"> On the edit menu select: <i>New->String Value</i>. </span> </li> <li class="listitem"> <span class="simpara"> Type in the extension you wish to use for your php scripts. For example <i>.php</i> </span> </li> <li class="listitem"> <span class="simpara"> Double click on the new string value and enter the path to <var class="filename">php.exe</var> in the value data field. ex: <var class="filename">C:\php\php.exe "%s" %s</var> for PHP 4, or <var class="filename">C:\php\php-cgi.exe "%s" %s</var> for PHP 5. </span> </li> <li class="listitem"> <span class="simpara"> Repeat these steps for each extension you wish to associate with PHP scripts. </span> </li> </ul> </p> <p class="para"> The following steps do not affect the web server installation and only apply if you want your PHP scripts to be executed when they are run from the command line (ex. run <var class="filename">C:\myscripts\test.php</var>) or by double clicking on them in a directory viewer window. You may wish to skip these steps as you might prefer the PHP files to load into a text editor when you double click on them. </p> <p class="para"> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> Navigate to: <i>HKEY_CLASSES_ROOT</i> </span> </li> <li class="listitem"> <span class="simpara"> On the edit menu select: <i>New->Key</i>. </span> </li> <li class="listitem"> <span class="simpara"> Name the key to the extension you setup in the previous section. ex: <i>.php</i> </span> </li> <li class="listitem"> <span class="simpara"> Highlight the new key and in the right side pane, double click the "default value" and enter <i>phpfile</i>. </span> </li> <li class="listitem"> <span class="simpara"> Repeat the last step for each extension you set up in the previous section. </span> </li> <li class="listitem"> <span class="simpara"> Now create another <i>New->Key</i> under <i>HKEY_CLASSES_ROOT</i> and name it <i>phpfile</i>. </span> </li> <li class="listitem"> <span class="simpara"> Highlight the new key <i>phpfile</i> and in the right side pane, double click the "default value" and enter <i>PHP Script</i>. </span> </li> <li class="listitem"> <span class="simpara"> Right click on the <i>phpfile</i> key and select <i>New->Key</i>, name it <i>Shell</i>. </span> </li> <li class="listitem"> <span class="simpara"> Right click on the <i>Shell</i> key and select <i>New->Key</i>, name it <i>open</i>. </span> </li> <li class="listitem"> <span class="simpara"> Right click on the <i>open</i> key and select <i>New->Key</i>, name it <i>command</i>. </span> </li> <li class="listitem"> <span class="simpara"> Highlight the new key <i>command</i> and in the right side pane, double click the "default value" and enter the path to <var class="filename">php.exe</var>. ex: <i>c:\php\php.exe -q %1</i>. (don't forget the <i>%1</i>). </span> </li> <li class="listitem"> <span class="simpara"> Exit Regedit. </span> </li> <li class="listitem"> <span class="simpara"> If using PWS on Windows, reboot to reload the registry. </span> </li> </ul> </p> <p class="simpara"> PWS and IIS 3 users now have a fully operational system. IIS 3 users can use a nifty <a href="http://www.genusa.com/iis/iiscfg.html" class="link external">» tool</a> from Steven Genusa to configure their script maps. </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="install.windows.activescript.html">ActiveScript</a></div> <div class="next" style="text-align: right; float: right;"><a href="install.windows.apache1.html">Apache 1.3.x on Microsoft Windows</a></div> <div class="up"><a href="install.windows.html">Installation on Windows systems</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?