Disable Directory Browsing in php.ini

Discussion in 'PHP' started by SGBoise, Nov 8, 2008.

  1. #1
    Awhile ago I read somewhere on how to disabled directory browsing in php.ini but I can't remember where I read it. I tried googling it but didn't find anything on how to do it in php.ini.

    Does anyone know the command to disable it?

    Thanks.:D
     
    SGBoise, Nov 8, 2008 IP
  2. vagrant

    vagrant Peon

    Messages:
    2,284
    Likes Received:
    181
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I also just did a search but could not find a way in php.ini

    However ... If you are using Apache
    then in your .htaccess file add on a new line
    Options All -Indexes
    Code (markup):
     
    vagrant, Nov 8, 2008 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can do this in your httpd.conf file for apache, but not the php.ini file as far as I am aware. And it's using the -Indexes in your <directory> section like is mentioned above
    <Directory />
    Options All -Indexes
    </Directory>
     
    JAY6390, Nov 8, 2008 IP
  4. SGBoise

    SGBoise Peon

    Messages:
    647
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks guys. Really appreciate your help.
     
    SGBoise, Nov 9, 2008 IP