This week's book giveaway is in the Agile forum.
We're giving away four copies of Fixing your Scrum and have Ryan Ripley & Todd Miller on-line!
See this thread for details.
Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Apache2.4.46-32 bit not loading PHP5.3.29 in Windows Server 10, 64 bit

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

I executed:
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 entry as:


<IfModule dir_module>
   DirectoryIndex index.html
   #Needed to add
   DirectoryIndex index.php
   DirectoryIndex index.php3
   DirectoryIndex index.php4
   DirectoryIndex index.php5
</IfModule>


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.





 
Saloon Keeper
Posts: 24174
165
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't speak with a lot of certainty, since I don't run critical Internet apps under Windows, but I would recommend that on 64-bit Windows you should install 64-bit Apache. At the very least, it would be able to better exploit the resources of a 54-bit OS.

And you should really consider upgrading PHP. Running old software is generally a security risk and it's harder to get support when things don't work/stop working.

The one thing that I really wonder about is that you're using a path with forward slashes to point to your PHP module. While I definitely recommend doing that for Java apps, I'm not sure if Apache will handle that properly. Unless instructions explicitly say not to, I'd try the traditional backslash path style.
 
Marshal
Posts: 22386
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Gho wrote: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


The php5apache2_2.dll file is written for Apache 2.2, it doesn't work with Apache 2.4. You need php5apache2_4.dll instead. I don't think that PHP 5.3 has that, so you should definitely listen to Tim and upgrade. Apache 5.3 has been EOL for years already; even 5.6 is EOL (I'm not sure what the minimum supported 7.x version is).

There were some breaking changes from 5.6 to 7.0, so if you really don't have the time to fix any errors, at least upgrade to the latest 5.6 version. Otherwise just go for the latest 7.x.

Tim Holloway wrote:The one thing that I really wonder about is that you're using a path with forward slashes to point to your PHP module. While I definitely recommend doing that for Java apps, I'm not sure if Apache will handle that properly. Unless instructions explicitly say not to, I'd try the traditional backslash path style.


That's not a problem, I use that as well.
 
Tim Holloway
Saloon Keeper
Posts: 24174
165
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:
There were some breaking changes from 5.6 to 7.0, so if you really don't have the time to fix any errors, at least upgrade to the latest 5.6 version. Otherwise just go for the latest 7.x.



And if you don't have time, schedule some ASAP after the current project is done. PHP is not famous for security. You want the best support you can get.
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic