index.php not loading by default
Apache needs to be configured to recognize index.php as an index file.
The simplest way to accomplish this..
Create a .htaccess file in your web root.
Add the line...
DirectoryIndex index.php
Here is a resource regarding the matter...
http://www.twsc.biz/twsc_hosting_htaccess.php
Edit: I'm assuming apache is configured to allow .htaccess files. If it isn't, you'll have to modify the setting in apache's configuration file (httpd.conf)
index.php is not loading by default in apache2
This is likely a caching issue in your browser when you go to http://localhost/
try pressing Ctrl
+ F5
index.php is not loaded by default
Apache
Create a .htaccess
file under the root of your project and put this:
DirectoryIndex index.php
Nginx
$ cd /etc/nginx/sites-available/default
Index index.html index.htm, index.php;
Lighttpd
$ nano /etc/lighttpd/lighttpd.conf
index-file.names = ( "index.php", "index.html" )
apache not returning index.php as default
You are missing following configuration:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html \
default.htm home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
Related Topics
Laravel: Syntax Error or Access Violation: 1055 Error
How to Find Entry by Object Property from an Array of Objects
How to Extend Access Token Validity Since Offline_Access Deprecation
How to Remove Line Breaks (No Characters!) from the String
Using an Array as Needles in Strpos
Fatal Error: Call to Undefined Function MySQL_Connect()
Preserving Session Variables Across Different Domains
Strict Standards: MySQLi_Next_Result() Error With MySQLi_Multi_Query
Print Numeric Values to Two Decimal Places
PHPdoc Type Hinting For Array of Objects
How to Post Pictures to Instagram Using API
PHP Regex to Match Outside of HTML Tags
PHP With MySQL 8.0+ Error: the Server Requested Authentication Method Unknown to the Client
PHP: Custom Error Handler - Handling Parse & Fatal Errors
How to Put Composite Keys in Models in Laravel 5
Create Word Document Using PHP in Linux
How to Load a Controller from Another Controller in Codeigniter