Index.php not opening

Asked
Active3 hr before
Viewed126 times

6 Answers

index
90%

Stack Overflow help chat , Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers , Meta Stack Overflow ,I have just installed CentOS, Apache and PHP. When I visit my site http://example.com/myapp/, it says "forbidden". By default it's not loading the index.php file.

Adding the following to your httpd.conf (if you have access to it) is considered better form, causes less server overhead and has the exact same effect:

<Directory /myapp>
   DirectoryIndex index.php
</Directory>
load more v
88%

The first thing we must do is modify the main Apache 2 configuration file. To do this, open a terminal window and issue the command:

sudo nano / etc / apache2 / apache2.conf
load more v
72%

The is a short guide on how to solve the issue of index.php files not being served as the default file (aka the DirectoryIndex). Example: You browse to your website and the web server lists the files and folders in your public web root or you are met with a nasty 403 forbidden error.,In the config snippet above, we tell Apache that index.php is the DirectoryIndex. We also specify that index.html should be used as the DirectoryIndex if a index.php file is not present inside the current directory., Size does matter in a fight. However, it is not the deciding factor. ,To fix the issue with Apache web server, you will need to tell it that “index.php” files should be treated the same as “index.html” files. A quick fix is to create a .htaccess file with the following line:

To fix the issue with Apache web server, you will need to tell it that “index.php” files should be treated the same as “index.html” files. A quick fix is to create a .htaccess file with the following line:

#The DirectoryIndex is index.php
DirectoryIndex index.php index.html
load more v
65%

It appears that you don't have the mod_rewrite module enabled in apache. This explains why you can access the dashboard found at wp-admin/index.php, but not the main index.php. Your .htaccess is depending on the rewrite module to do its work, which isn't active.,But for sure it has something to do with missing apache modules.,And remove the "#" this uncomments the inclusion and tells apache to load the module. You then need to restart apache for the changes to take effect.,In the file apache/httpd.conf you must add index.php in <ifMdule>:

Personally I would recommend that the following modules are loaded:

LoadModule authz_host_module modules / mod_authz_host.so
LoadModule log_config_module modules / mod_log_config.so
LoadModule expires_module modules / mod_expires.so
LoadModule deflate_module modules / mod_deflate.so
LoadModule headers_module modules / mod_headers.so
LoadModule setenvif_module modules / mod_setenvif.so
LoadModule mime_module modules / mod_mime.so
LoadModule autoindex_module modules / mod_autoindex.so
LoadModule dir_module modules / mod_dir.so
LoadModule alias_module modules / mod_alias.so
LoadModule rewrite_module modules / mod_rewrite.so
load more v
75%

chmod 0750 public_html
40%

Filesystem Security , In general, security by obscurity is one of the weakest forms of security. But in some cases, every little bit of extra security is desirable. , Database Security , Session Security

# Make PHP code look like other code types
AddType application / x - httpd - php.asp.py.pl
load more v

Other "index-undefined" queries related to "Index.php not opening"