Static files not listed using IIS Express
2 posts
• Page 1 of 1
Static files not listed using IIS Express
Hello
For the past hour I've been struggling a bit with a strange error/problem when using PHP Tools and IIS Express.
Basically, all non-php files were not listed by IIS Express, thus all *.js, *.css, *.png and so on would produce a 404
After some trial and error, I finally found a solution, by adding the following xml to the IIS Express configuration section for php:
The full php configuration section now looks like this:
Is this a common problem? I am not sure if you are able to do anything about this problem, but ideally PHP Tools should set this up.
At least, here's the solution if others are struggling
For the past hour I've been struggling a bit with a strange error/problem when using PHP Tools and IIS Express.
Basically, all non-php files were not listed by IIS Express, thus all *.js, *.css, *.png and so on would produce a 404
After some trial and error, I finally found a solution, by adding the following xml to the IIS Express configuration section for php:
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
The full php configuration section now looks like this:
- Code: Select all
<location path="PHPWebProject1">
<system.webServer>
<handlers>
<clear />
<add name="php-5.3.19_1" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" requireAccess="Script" />
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
</handlers>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</location>
Is this a common problem? I am not sure if you are able to do anything about this problem, but ideally PHP Tools should set this up.
At least, here's the solution if others are struggling
- havardhu
- Posts: 3
- Joined: March 18th, 2013, 9:54 pm
Re: Static files not listed using IIS Express
Hello,
Thank you for your post.
This was an issue of older release. The clear element shouldn't be in handler section in applicationHost.Config of IISExpress as it overrides default handlers. Simply deleting clear element or preferably updating PHP Tools should be sufficient.
For better convenience just turn on automatic updates in Visual Studio. ( http://www.devsense.com/doc/phptools/in ... ion#update )
Thank you,
Miloslav
Thank you for your post.
This was an issue of older release. The clear element shouldn't be in handler section in applicationHost.Config of IISExpress as it overrides default handlers. Simply deleting clear element or preferably updating PHP Tools should be sufficient.
For better convenience just turn on automatic updates in Visual Studio. ( http://www.devsense.com/doc/phptools/in ... ion#update )
Thank you,
Miloslav
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 56 guests