2023-01-14 437
部署网站前查看一下系统是否已经安装CGI
打开IIS服务器,点击网站,右击“添加网站”
点击“添加网站”后,进入页面填写网站相关内容,如:网站名称、物理路径(网站所在文件夹),点击“确定”创建成功
点击创建好的网站,点击“处理程序映射”,点击右侧的“添加映射模块”,在弹出层中输入对应的参数,点击确认
设置默认文档
点击“默认文档”,鼠标右击“添加”按钮,添加默认文档,输入index.php,点击“确定”添加
点击“URL重写”,点击右侧的“导入规则”,选择要导入的规则文件,点击应用即可
应用规则后,网站所在根目录会生成一个web.config文件,我这个用的是thinkphp的.htaccess文件导入的规则
文件内容:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="已导入的规则 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<handlers>
<add name="php-cgi" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="D:\phpStudy\php56n\php-cgi.exe" resourceType="File" />
</handlers>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
以上所述是小编给大家介绍的IIS服务器中部署PHP案例详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!
原文链接:https://77isp.com/post/25532.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态