windows server 2019如何开启iis服务器和tp5.1的配置运行

发布时间:2022-03-03 13:45:43 作者:小新
来源:亿速云 阅读:551

这篇文章将为大家详细讲解有关windows server 2019如何开启iis服务器和tp5.1的配置运行,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

一、新建IIS服务器

windows server 2019如何开启iis服务器和tp5.1的配置运行

然后一直点击下一步,直到下图所示:

windows server 2019如何开启iis服务器和tp5.1的配置运行

选择上如下图所选:

windows server 2019如何开启iis服务器和tp5.1的配置运行

然后下一步安装上即可。

二、IIS服务器配置

新建网站如下图所示:

windows server 2019如何开启iis服务器和tp5.1的配置运行

点击基本设置,按要求填写即可:

windows server 2019如何开启iis服务器和tp5.1的配置运行

双击处理映射程序

windows server 2019如何开启iis服务器和tp5.1的配置运行

弹出如下图所示:

windows server 2019如何开启iis服务器和tp5.1的配置运行

点击添加模块映射,填写如下图所示:

windows server 2019如何开启iis服务器和tp5.1的配置运行

接下来:

windows server 2019如何开启iis服务器和tp5.1的配置运行

双击默认文档,添加index.php:

windows server 2019如何开启iis服务器和tp5.1的配置运行

三、下载php,并配置

链接:https://windows.php.net/downloads/releases/php-7.3.17-nts-Win32-VC15-x64.zip,注意php-7.4对tp5.1支持有问题,所以最好用php7.3

windows server 2019如何开启iis服务器和tp5.1的配置运行

把上面的复制一份,修改为php.ini

修改php.ini如下所示:

zlib.output_compression = On //启用Gzip压缩
max_execution_time = 30 //最大执行时间,按需改
memory_limit = 128M //内存大小限制
display_errors = Off //关闭报错
error_log = e:\temp\php_errors.log
post_max_size = 100M //最大POST大小,按需改
extension_dir = "e:\PHP\ext" //ext文件夹位置
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
fastcgi.logging = 0
upload_tmp_dir = e:\temp
upload_max_filesize = 100M //最大上传大小,按需改
date.timezone = Asia/shanghai //时区
session.save_path = "e:\temp"
session.auto_start = 0
sys_temp_dir = "e:\web\temp\tmp"

开启扩展:

extension=xxxxx //去掉前面的分号以启用对应扩展

我打开了这些:curl、fileinfo、gd2、gettext、mbstring、exif、mysqli、openssl、pdo_mysql、xmlrpc

四、IIS url rewrite错误

win+R 输入 regedit
在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp位置

修改注册表

把MajorVersion的值改为9

下载:https://www.iis.net/downloads/microsoft/url-rewrite

并安装即可。

五、tp5的配置

在public文件夹下添加web.config,并填写如下内容。

<?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>
        <defaultDocument>
            <files>
                <add value="index.php" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

如果:tp5报错:Non-string needles will be interpreted as strings in the future

修改错误:.\extend\XBase\Column.php

$this->name = (strpos($name, 0x00) !== false ) ? substr($name, 0, strpos($name, 0x00)) : $name;改为:

$this->name = (strpos($name, chr(0x00)) !== false ) ? substr($name, 0, strpos($name, chr(0x00))) : $name;

整个流程走下来,tp5可以完美运行到服务器上。

关于“windows server 2019如何开启iis服务器和tp5.1的配置运行”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. Windows Server 2019 Core
  2. windows server 2003下IIS的安装配置

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

windows server 服务器

上一篇:Javaweb进程与线程的示例分析

下一篇:Vue.js组件是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》