Directory Listing Denied.  PHP

Posted on 2004-11-04
Last Modified: 2008-03-06
i installed

Windows 2000 Pro  SP3
PHP 4 ,Apache 2.0.52 win32  &  IIS

While i tried to run the Php application TEST. i found the following problem. In browser i typed the name like  "http://localhost/test/"  but in the browser its display the error like.

"Directory Listing Denied.
 This Virtual Directory does not allow contents to be listed."
Question by:Viji4u

    Author Comment

    if i try to call the function like   "http://localhost/test/index.php" in IE6, its display the source of index.php

    is there any setting in IIS? how to set that? i am new to these basic setups.

    how to solve this problem?  
    LVL 5

    Accepted Solution

    Right click on My Computer, Select Manage, scroll down to "Services And Applications" expand this out to the "Internet Information Services" tree, and expand down to your virtual directory. Right click and select "Properties". On the "Home Directory" tab you can select "Allow Directory Browsing" if you want to browse directories. That will get rid of the Vidtual Directory does not allow contents to be listed. If you want it to render index.php as the default page for a directory, Select the "Documents" tab and click add, enter index.php and press ok, press ok a few times to close your dialogs.

    You will now be able to see index.php displayed if you go to http://localhost/test

    Now the next problem is that you are getting the Source of the index.php file. This is because you have not installed PHP into your IIS Server. This ( section of the PHP manual details how to install PHP into IIS.

    Now you list that you also have Apache on your system. It seems possible to me that you have a configured Apache instance running, with PHP in it, and you have put your php files into your IIS instance instead. Apache is a web server. So is IIS. You only need one of them. On windows I'd suggest using IIS as it's native to windows and pretty well integrated. Running Apache is possible, and not too much of a problem, but if you are new to this, then using IIS may be less painful.

    You can of course download the CGI version of PHP from here:

    Which will give you PHP 4.3.9 installed directly (and working) into your IIS instance, this is what I use at home for development. Then it's just a case of adding index.php as a default document as I explained at first.

    Author Comment

    Thanks lot for details.

    now. Its working fine
    LVL 5

    Expert Comment

    Happy to help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now