I kind of wonder if anyone can advise or point me in the right direction:
My host system is Debian 8.4, running Virtualbox 5.0.24 on which CentOS7 is installed, running Apache 2.4, php 5.4.16 and phpMyAdmin. As far as i remember CentOS was installed headless with minimum security in a mind.
All working fine, there is a folder on host Debian which is mounted automatically in guest CentOS in /var/www/html. Any change to script in this folder is acknowledged by other side (CentOS) in sense that if I refresh browser in host which reads that script the change is displayed.
I would like to configure it the way that any file ending in .html would be parsed as php - right now any php code within such html file is kindly ignored :’(
Obviously, once the file extension is changed from .html to .php it works without any problem.
Googled it some and come across a solution which somehow did not work for me (at least for what i tried): .htaccess
The question is - instead of creating some extra configuration file can the same be achieved by configuring either php.ini or perhaps httpd.conf?
Well you know, i am stubborn muppet & could have installed xamp or something like that but why not to make the life much more difficult?
Completely forgot to ask for an opinion in original post whether it is worth of effort…
This is just my own setup for my personal learning, sometimes i come across such a code (forum’s beginners section, book etc…)
So I do not need it that desperately, just being curious, if I could get html done by browser directly and only php bits by php.
Looks like some studying on pretty url & apache config would be beneficial?
The key here is to name the file as .php (like your example list.php).
If this is changed to list.html then obviously php bits will not do much - that is precisely the reason why i wanted to know more about .htaccess.
Thinking that eventually by using .htaccess ( ,AddType application/x-httpd-php .html .htm) i would achieve exactly the same as if naming file directly as .php , just was not sure if there was no trick hidden/bad practice in doing it that way…
I am perfectly fine with the example, in fact that’s what I have been doing anyway - it just takes me bit longer to digest all info lol…