h5ai
h5ai copied to clipboard
Can I config h5ai with IIS?
If yes. any tuts? Thanks
I find nothing about h5ai with iis under windows.
Thanks
Really simple: Example web root: C:\inetpub\wwwroot
Copy _h5ai folder to web root. You should have something like: C:\inetpub\wwwroot\_h5ai\public C:\inetpub\wwwroot\_h5ai\private with few other files. Add to "default documents" Name: _h5ai/public/index.php and move it to first place. It works out of a box with PHP enabled.
I have this working on IIS, but unfortunately sub-directories do not work. Behind the scenes, a POST request is failing with a 405
Do you have multiple handlers for POST/GET configured? It's often a reason for 405. And which version of a server?
It's pretty much the default configuration for PHP in IIS. I haven't customized any handlers for any verbs. And it's only an issue with subdirectories, it works in the root folder.
Add rewrite rule:
<rewrite>
<rules>
<rule name="RewriteAll" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
In the subdirectory or the root?
Root Web.config
You did it! Thank you!
For some reason I cannot get it to work with subdirectories either yet the rewrite rule gives simply an error when I try to check the default document in IIS on the domain if I edit the web.config file. So it simply stays a 403. This is on IIS 10.
It does work on the folder h5ai is installed in.
Weird, 403 looks like permissions problem. Directory browsing without h5ai works?
when I turn on directory browsing yes, but in h5ai the subdirs although seen in h5ai show nothing although it has files. If I go there directly I get the iis listing.
Also your web.config is partially incomplete I believe. it needs <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> aswell because without it I couldn't even see the subdirs and the rewrite module needs to be installed which isn't by new IIS installations.
I would say that this is only part of the web.config file that you should add to web.config instead of replacing it. Right now i can't test it for IIS 10 to confirm yours problem. But I think this configuration should also work on this version of IIS smoothly.
<configuration>
<system.webServer>
Paste here
... Other config options ....
</system.webServer>
</configuration>
tried it as follows added _h5ai/public/index.php to the default documents (as last) also tried /h5ai... and ~/h5ai... else it will take over normal index behaviour and you don't want that in most cases.
then my web.config looks like this
<configuration>
<system.webServer>
<directoryBrowse enabled="True" />
<rewrite>
<rules>
<rule name="RewriteAll" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Hello,
I've got the issue with h5ai on IIS. The subdirectories show EMPTY, but there are files.
My web.config
<configuration>
<system.webServer>
<directoryBrowse enabled="True" />
<rewrite>
<rules>
<rule name="RewriteAll" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<add value="_h5ai/public/index.php" />
</files>
</defaultDocument>
<staticContent>
<mimeMap fileExtension="*" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>
Gente, eu resolvi esse problema depois de dias e trocando para xampp, entrei no site aqui https://ivampiresp.com/2020/01/16/iis%E4%B8%8B%E6%90%AD%E5%BB%BAh5ai%E6%96%B9%E6%B3%95%EF%BC%88%E5%8C%85%E6%8B%AC%E5%B8%B8%E8%A7%81%E7%9A%84%E4%B8%80%E4%BA%9B%E5%9D%91%EF%BC%89.html site chinês mesmo!!
tem que ter instalado ->https://www.iis.net/downloads/microsoft/url-rewrite
**
Web.config
<system.webServer>
<directoryBrowse enabled="True" />
<rewrite>
<rules>
<rule name="RewriteAll" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>