Apache looking for .html instead of .php

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.



#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.


# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>


<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>

<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/

DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm

ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined

Redirect permanent / https://domain.nu/

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


I disabled the default 000-default.conf file and made my own domain.nu.conf file for the configurations.







share|improve this question





















  • Do you enable mod_php in apache ?
    – Kiwy
    Jul 4 at 13:16










  • Yes I did @Kiwy
    – Sergio
    Jul 4 at 13:20






  • 5




    Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
    – ivanivan
    Jul 4 at 14:23














up vote
1
down vote

favorite












I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.



#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.


# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>


<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>

<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/

DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm

ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined

Redirect permanent / https://domain.nu/

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


I disabled the default 000-default.conf file and made my own domain.nu.conf file for the configurations.







share|improve this question





















  • Do you enable mod_php in apache ?
    – Kiwy
    Jul 4 at 13:16










  • Yes I did @Kiwy
    – Sergio
    Jul 4 at 13:20






  • 5




    Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
    – ivanivan
    Jul 4 at 14:23












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.



#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.


# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>


<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>

<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/

DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm

ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined

Redirect permanent / https://domain.nu/

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


I disabled the default 000-default.conf file and made my own domain.nu.conf file for the configurations.







share|improve this question













I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.



#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.


# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>


<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>

<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/

DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm

ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined

Redirect permanent / https://domain.nu/

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


I disabled the default 000-default.conf file and made my own domain.nu.conf file for the configurations.









share|improve this question












share|improve this question




share|improve this question








edited Jul 4 at 13:59









Debian_yadav

8322522




8322522









asked Jul 4 at 13:12









Sergio

62




62











  • Do you enable mod_php in apache ?
    – Kiwy
    Jul 4 at 13:16










  • Yes I did @Kiwy
    – Sergio
    Jul 4 at 13:20






  • 5




    Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
    – ivanivan
    Jul 4 at 14:23
















  • Do you enable mod_php in apache ?
    – Kiwy
    Jul 4 at 13:16










  • Yes I did @Kiwy
    – Sergio
    Jul 4 at 13:20






  • 5




    Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
    – ivanivan
    Jul 4 at 14:23















Do you enable mod_php in apache ?
– Kiwy
Jul 4 at 13:16




Do you enable mod_php in apache ?
– Kiwy
Jul 4 at 13:16












Yes I did @Kiwy
– Sergio
Jul 4 at 13:20




Yes I did @Kiwy
– Sergio
Jul 4 at 13:20




5




5




Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
– ivanivan
Jul 4 at 14:23




Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
– ivanivan
Jul 4 at 14:23















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453430%2fapache-looking-for-html-instead-of-php%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453430%2fapache-looking-for-html-instead-of-php%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?