IIS 配置thinkphp 路由配置及No input file specified等問題
阿新 • • 發佈:2021-01-24
IIS 配置thinkphp 路由配置及No input file specified等問題
1.關於iis如何配置php下面文章介紹的很詳細
https://blog.csdn.net/sdzcyds/article/details/80540819
2.下載的php沒有.exe型別的檔案,上面文章配置無法進行
可以用phpStudy 去下載php環境,複製到伺服器上。
3.iis環境下php.ini的幾個重要配置項
3.1 fastcgi.impersonate = 1 # 不開啟可能報500錯誤
3.2 cgi.fix_pathinfo=0
3.3 cgi.rfc2616_headers = 0
3.4 cgi.force_redirect = 0
3.5 open_basedir =“D:\wwwroot\你的網站檔案目錄;C:\tmp(你的快取目錄)”
3.6 session.save_path=“C:\tmp”
4.網站目錄許可權問題
要放開網站目錄許可權,找到網站目錄資料夾,右鍵屬性–安全–找到使用者組–編輯(iis使用者和預設user 給足夠的許可權)
5.tp路由要新增web.config檔案
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="OrgPage" stopProcessing="true"> <match url="^(.*)$" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(.*)$" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php?s=/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>