If I put the following line in a index.html
file, to make Apache include the index.php
file:
<?php include("/Live/ls_client/index.php"); ?>
visiting the index.html
page shows me this:
<!--?php include("/Live/ls_client/index.php"); ?-->
Why is that? Why doesn't it actually include the PHP file?
As of today (2015, Aug., 1st), Apache2
in Debian Jessie
, you need to edit:
root@host:/etc/apache2/mods-enabled$ vi dir.conf
And change the order of that line, bringing index.php to the first position:
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
PHP will work only on the .php
file extension.
If you are on Apache you can also set, in your httpd.conf
file, the extensions for PHP. You'll have to find the line:
AddType application/x-httpd-php .php .html
^^^^^
and add how many extensions, that should be read with the PHP interpreter, as you want.
Source: Stackoverflow.com