In the same Windows server machine (Windows 2016 server, 64 bit), Apache 2.2 is correctly loading PHP. I have a need to upgrade to Apache 2.4.46 on the same Windows server. In order to do so, I first uninstalled the existing Apache2.2 from the server. After that, I installed Apache2.4.6 in that server. In the new Apache2.4.46, I am not able to load PHP (5.3.29, from 2014).
Operating System in which I am working=Windows Server 2016, 64 bit
I attempted with both 64 bit and 32 bit of Apache.24 and both gave different errors, which made me think 32-bit needs to be installed.
With 64bit Apache2.4.46
With 64 bit, httpd-2.4.46-win64-VS16 download from Apache Lounge (https://www.apachelounge.com/download/
), install gives PHP related error as:
httpd.exe: Syntax error on line 583 of D:/Program Files (x86)/Apache Software Foundation/Apache24/conf/httpd.conf: Cannot load D:/Program Files (x86)/PHP/php5apache2_2.dll into server: %1 is not a valid Win32 application
With 32 bit Apache2.4.46
The above error made me think that I should use 32 bit.
With httpd-2.4.46-win32-VS16 (1) from Apache Lounge, the install gave me an error also.
D:\Program Files (x86)\Apache Software Foundation\Apache2.4.46\bin>httpd.exe -k install
The error obtained in executing the above command for 32 bit was:
httpd.exe: Syntax error on line 584 of D:/Program Files (x86)/Apache Software Foundation/Apache24/conf/httpd.conf: Cannot load D:/Program Files (x86)/PHP/php5apache2_2.dll into server: The specified procedure could not be found.
I have the httpd.config
#Needed to add
PHPIniDir "D:/Program Files (x86)/PHP"
AddType application/x-httpd-php .php
LoadModule php5_module "D:/Program Files (x86)/PHP/php5apache2_2.dll"
The PHP version is 5.3.29 from 2014. I do not wish to upgrade PHP, and it was correctly working with Apache2.2. The PHP dll file indeed exists in the correct folder. The PHP directory (which was correctly working with Apache 2.2) is not changed.
Any suggestions on:
1. Is 32-bit Apache2.4.46 the correct one?
2. Is ApacheLonge the correct one? As some other posts noted to go to this site instead of Apache.
3. Any help on what other configuration is needed in Apache, without requiring to change PHP.