Can you please confirm that the “it” you are talking about is Apache2?
And that the configuration parts you show are somewhere in the Apache 2 configuration files on the Apache server? And then please name that file!
Talking about “it” can be very confusing. I have seen cases here where people thought that the browser/client is responsible for processing the PHP and happily talked about “it” not doing it. Took some time before we found out that his “it” was Firefox where we thought “it” was Apache. The lesson is that one never can be too precise in describing computer problems.
What you think should be changed in /etc/apache2/conf.d/php7.conf are only suffixes of files that should be processed by PHP7 (you add the suffix php7 to the range). But as you use a file which ends in the suffix .php, it falls in that category already.
What you tell is that when having index.php in the URL it works as expected.
When omitting the file name, it falls back to directory indexing, but the DirectoryIndex statements tell it to use one of the files named there instead when available. Because index.php is there (I hope there are no other files there?) it will then serve index.php instead of doing directory indexing. But then it forgets to process it through php. Which worked in the PHP5 case.
Perhaps php7.conf is not included in your www.domain.local.conf file?
If this is a VirtualHost the file will probably either exist in /apache2/vhosts.d or there will be an entry in ip-based_vhosts.conf.
there is normally something like:
But you might have a list with php5.conf included.
Anyway please show your active server configuration files.
You would only need separate index.php entries for DirectoryIndex if you actually had page files with those names. I just have index.html and assign .html to be parsed by the PHP module.
Fixed (for now, hopefully it stays) but I can’t say I know the exact reason.
I added a new PHP module, php7-macros in this case, and when it restarted it worked correctly. I did a visual compare of the before and after of the apache configuration files (using meld and comparing against my nightly backups) and it seems to have re-ordered the loading of the apache modules. Maybe there was just some configuration change that didn’t happen when it was supposed to and that adding of the php module caused it to correct itself or maybe php had an issue that was fixed when the module was added. One of those is my best guess but I don’t really know for sure.
So… I had to install a couple of more php7 modules and once I did the problem returned but this time it doesn’t recognise PHP at all and even with http://domain/index.php it opens up a save box instead of executing PHP. Uhg!