curious1
curious1

Reputation: 14727

How to run PHP 5.2.13 on Apache 2.4.x?

I have a legacy PHP site, which runs on Apache 2.2 on a Windows server. Now I am asked to upgrade to Apache 2.4.

I downloaded Apache 2.4.33 and got it configured, but I always get errors for this line in httpd.conf:

LoadModule php5_module "C:/Tools/php-5.2.13/php5apache2_2.dll"
or
LoadModule php5_module "C:/Tools/php-5.2.13/php5apache2.dll"
or
LoadModule php5_module "C:/Tools/php-5.2.13/php5apache.dll"

The error message is:

httpd: Syntax error on line 573 of C:/Tools/Apache/Apache24/conf/httpd.conf: Cannot load C:/Tools/php-5.2.13/php5apache.dll into server: The specified module could not be found.

I cannot upgrade to higher PHP versions because the site would break. So I have two questions:

  1. How to run PHP 5.2.13 on Apache 2.4.x?

  2. What is the highest Apache version PhP 5.2.13 can work with?

I did quite online research, but failed to find the answer. Any info is really appreciated.

Upvotes: 4

Views: 5966

Answers (1)

MonkeyZeus
MonkeyZeus

Reputation: 20747

Since you are presumably using Windows with the .dll extension then you can download the correct php5apache2_4.dll from ApacheLounge for PHP 5.2

If that link is broken then try finding the DLL at https://www.apachelounge.com/download/additional/


The other option is to switch to FCGI. I am personally using FCGI to run all of the latest patch PHP versions from 4.3.x to 7.2.x on my Apache 2.4.

Upvotes: 3

Related Questions