時間:2022-03-02來源:www.nowordz.com作者:電腦系統城
然后一直點擊下一步,直到下圖所示:
選擇上如下圖所選:
然后下一步安裝上即可。
新建網站如下圖所示:
點擊基本設置,按要求填寫即可:
雙擊處理映射程序
彈出如下圖所示:
點擊添加模塊映射,填寫如下圖所示:
接下來:
雙擊默認文檔,添加index.php:
鏈接:https://windows.php.net/downloads/releases/php-7.3.17-nts-Win32-VC15-x64.zip,注意php-7.4對tp5.1支持有問題,所以最好用php7.3
把上面的復制一份,修改為php.ini
修改php.ini如下所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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
win+R 輸入 regedit
在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp位置
修改注冊表
把MajorVersion的值改為9
下載:https://www.iis.net/downloads/microsoft/url-rewrite
并安裝即可。
在public文件夾下添加web.config,并填寫如下內容。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<? 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可以完美運行到服務器上。
2022-04-19
CentOS8使用阿里云yum源異常問題及解決方法2022-04-15
手把手教小白CentOS7安裝GlusterFS集群的全過程圖解2022-04-15
服務器使用Nginx部署Vue項目教程圖解創建項目勾選Web Application勾選【JavaEE Application】名字不是主要的項目結構:創建一個測試的【servlet】 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...
2022-04-15
. HTTP協議介紹 3. HTTP的消息結構 4. HTTP交互流程 5. 案例代碼: 搭建HTTP服務器 6. 最終運行的效果...
2022-04-15