Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Using PHP with MySQL Limiting Records in SQL Queries Using LIKE

Hugo Gaboury
Hugo Gaboury
2,531 Points

HTTP Error 403.14 - Forbidden

Hi,

I was following the course on "Using PHP with MySQL" and I downloaded the project. The contact and search pages work fine, but the shirts.php and shirt.php file don't. When I load the website and click on the link to see the shirts, it gives me this error:

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

Things you can try: If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists. Enable directory browsing. Go to the IIS Express install directory. Run appcmd set config /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the server level. Run appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the site level. Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

Detailed Error Information: Module DirectoryListingModule Notification ExecuteRequestHandler Handler StaticFile Error Code 0x00000000 Requested URL http://localhost:8155/shirts/ Physical Path C:\Users\Hugo\Documents\My Web Sites\EmptySite12\shirts\ Logon Method Anonymous Logon User Anonymous Request Tracing Directory C:\Users\Hugo\Documents\IISExpress\TraceLogFiles\EMPTYSITE12

More Information: This error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server. View more information ยป

and the same when I click on a particular shirt to see its details, I get this error: HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

BUT, it works if I just launch shirts.php in my browser from my editor and the same thing for shirt.php

I went in iis Manager in "Default Web Site" -> "Directory Browsing" and on the Action pane on the right, I click "Disable" and the "Enable" to make sure it was enabled.

I also went to "Defautl Web Site" -> "Default Document" and added index.php since it wasn't there

But neither of these two things fixed my problem. And now, I can't oper "Default Document" anymore because it gives me an error saying "C:\inetpub\wwwroot\web.config Line number:7 Cannot add duplicate collection entry of type 'add' with unique key attribute 'value' set to 'index.php' ".

Does anyone have solution for that?

Thx