windows server 2019開啟iis服務(wù)器+tp5.1的完美配置運(yùn)行流程
目錄
- 一、新建IIS服務(wù)器
- 二、IIS服務(wù)器配置
- 三、下載php,并配置
- 四、IIS url rewrite錯(cuò)誤
- 五、tp5的配置
一、新建IIS服務(wù)器
然后一直點(diǎn)擊下一步,直到下圖所示:
選擇上如下圖所選:
然后下一步安裝上即可。
二、IIS服務(wù)器配置
新建網(wǎng)站如下圖所示:
點(diǎn)擊基本設(shè)置,按要求填寫即可:
雙擊處理映射程序
彈出如下圖所示:
點(diǎn)擊添加模塊映射,填寫如下圖所示:
接下來:
雙擊默認(rèn)文檔,添加index.php:
三、下載php,并配置
鏈接:https://windows.php.net/downloads/releases/php-7.3.17-nts-Win32-VC15-x64.zip,注意php-7.4對(duì)tp5.1支持有問題,所以最好用php7.3
把上面的復(fù)制一份,修改為php.ini
修改php.ini如下所示:
zlib.output_compression = On //啟用Gzip壓縮max_execution_time = 30 //最大執(zhí)行時(shí)間,按需改memory_limit = 128M //內(nèi)存大小限制display_errors = Off //關(guān)閉報(bào)錯(cuò)error_log = e:\temp\php_errors.logpost_max_size = 100M //最大POST大小,按需改extension_dir = "e:\PHP\ext" //ext文件夾位置cgi.force_redirect = 0cgi.fix_pathinfo=1fastcgi.impersonate = 1fastcgi.logging = 0upload_tmp_dir = e:\tempupload_max_filesize = 100M //最大上傳大小,按需改date.timezone = Asia/shanghai //時(shí)區(qū)session.save_path = "e:\temp"session.auto_start = 0sys_temp_dir = "e:\web\temp\tmp"
開啟擴(kuò)展:
extension=xxxxx //去掉前面的分號(hào)以啟用對(duì)應(yīng)擴(kuò)展
我打開了這些:curl、fileinfo、gd2、gettext、mbstring、exif、mysqli、openssl、pdo_mysql、xmlrpc
四、IIS url rewrite錯(cuò)誤
win+R 輸入 regedit
在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp位置
修改注冊(cè)表
把MajorVersion的值改為9
下載:https://www.iis.net/downloads/microsoft/url-rewrite
并安裝即可。
五、tp5的配置
在public文件夾下添加web.config,并填寫如下內(nèi)容。
<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer><rewrite> <rules><rule name="已導(dǎo)入的規(guī)則 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報(bào)錯(cuò):Non-string needles will be interpreted as strings in the future
修改錯(cuò)誤:.\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;
整個(gè)流程走下來,tp5可以完美運(yùn)行到服務(wù)器上。
到此這篇關(guān)于windows server 2019開啟iis服務(wù)器+tp5.1的配置的文章就介紹到這了,更多相關(guān)windows server 2019開啟iis內(nèi)容請(qǐng)搜索以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持!
相關(guān)文章:
1. Windows Server 2019 IIS10.0+PHP(FastCGI)+MySQL環(huán)境搭建教程2. Windows Server 2019 DNS服務(wù)器的配置與管理之DNS正向解析3. windows server 2019 關(guān)機(jī)重啟問原因解決方法(關(guān)閉事件跟蹤程序)4. Windows Server 2019 DNS服務(wù)器配置方法(入門篇)5. Windows server 2019 如何安裝IIS并勾選正確參數(shù)6. Windows Server 2019 Web服務(wù)器配置 IIS站點(diǎn)配置7. Windows Server 2019 Ipsec 安全策略(實(shí)現(xiàn)兩機(jī)之間的安全通信)8. Windows Server 2019 WEB和FTP服務(wù)器的配置方法9. Windows Server 2019安裝域控制器(圖文教程)10. Windows Server 2019 standard安裝配置DHCP服務(wù)
