So almost all the time, this problem is down to a mismatch of Windows x32/x64 versions of Apache and PHP or the respective Binary versions. But I've triple checked and quadruple checked that they are the correct versions. So now I'm thoroughly stumped.
Here's the lines I added to the bottom of the httpd.conf file:
AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .html .htm
LoadModule php7_module "C:/php/php7apache2_4.dll"
PHPIniDir "C:/php"
Without this, Apache runs completely fine. But then when I add this bit to install PHP, the following error comes up:
httpd: Syntax error on line 535 of C:/Apache24/conf/httpd.conf: Cannot load C:/php/php7apache2_4.dll into server: %1 is not a valid Win32 application.
The versions I downloaded are:
httpd-2.4.29-Win64-VC15
php-7.2.1RC1-Win32-VC15-x64
I believe these are compatible bit and binary versions. Win64 and VC15 for both (I am confident the "Win32" in php download doesn't signify a Win32 version after spending much time researching if that was my problem).
Any ideas what is going on here?
Thanks.