# Index.php not loading automatically

**URL:** https://forum.kirupa.com/t/index-php-not-loading-automatically/262256
**Category:** Uncategorized
**Created:** [June 4, 2008, 1:24pm UTC](https://forum.kirupa.com/t/index-php-not-loading-automatically/262256 "2008-06-04T13:24:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tecktalk](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@tecktalk](https://forum.kirupa.com/u/tecktalk)
#### Post date: [June 4, 2008, 1:24pm UTC](https://forum.kirupa.com/t/index-php-not-loading-automatically/262256/1 "2008-06-04T13:24:42Z")

</div>

Hello members,  
I have installed the Apache Server and PHP on my laptop. I am able to view webpages with a .php extension, so I can safely assume that PHP has been set up correctly, however, my index pages index.php do not automatically load. Whenever I browse through the localhost to one of my “local” websites, it just shows me a list of files in the root, and I have to manually click the “index.php”. Is there something that I am missing here?  
I would appreciate the assistance.  
Thanks

---

<div class="post-metadata">

### Author: ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)
#### Post date: [June 4, 2008, 1:58pm UTC](https://forum.kirupa.com/t/index-php-not-loading-automatically/262256/2 "2008-06-04T13:58:57Z")

</div>

Assuming it is Apache 2.0, you might want to make sure you have a cgi handler for .php as well as make sure the index names are connected…

in httpd.conf, look for these lines. if they don’t exist; add them:

```php

LoadModule php5_module /usr/lib/apache2/mod_php5.so
AddType application/x-httpd-php .php

```

If your php files are loading normally, just that it’s not getting the ‘index’ thingie, look for this line;

```php

DirectoryIndex index.php index.asp index.htm index.html

```

And make sure it has a index.php there.

Alternatively, if you can’t access your httpd.conf (which you probably can since you’re running it locally… but still) you can add this information in a .htaccess file in the wwwroot.

---

<div class="post-metadata">

### Author: ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)
#### Post date: [June 4, 2008, 2:02pm UTC](https://forum.kirupa.com/t/index-php-not-loading-automatically/262256/3 "2008-06-04T14:02:12Z")

</div>

Oh, almost forgot… You might want to disable directory listing as well (Not that any security problems exists locally, but it’s a good habit to learn.

```php

<Directory />
Options -Indexes
</Directory>

```
