Static files not listed using IIS Express

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Static files not listed using IIS Express

Postby havardhu » March 28th, 2013, 2:34 pm

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:

<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

Postby Miloslav Beno » March 28th, 2013, 3:06 pm

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
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 56 guests

cron

User Control Panel

Login

Who is online

In total there are 56 users online :: 0 registered, 0 hidden and 56 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 56 guests