Apache start failing after apache config modifications, showing syntax error, cannot load php5apache2_2.dll into server
Solution 1:
Most likely you have incompatible Apache build. You have not mentioned where did you download Apache HTTPD from + what PHP version do you have.
Get latest Apache build from Apache Lounge website -- their builds are compiled with VC9 while apache.org builds are still VC6. You need VC9 build as that is how official PHP builds are compiled now (you can read small explanation on PHP for Windows website -- see link in #2).
Get Thread-Safe build of PHP from PHP for Windows (based on your question you want to run it as Apache module). If you want to run it as FastCGI, then Non-thread safe build is required.
Disable all non-default php extensions (until you successfully start Apache with PHP working).
Configure your PHP and Apache if necessary (those Apache config lines you have mentioned so far are fine).
P.S. "copied the necessary .dll files from inside php5 installation folder (like they were in the working setup of teammates) to my windows/system32/"
You are on x64 bit version of Windows.
C:\windows\system32\
is for 64-bit processes/files ONLY. In your case Apache and PHP are x32 so the correct place would beC:\Windows\SysWOW64
.There is no real reason to copy those files there -- you could add your PHP installation path (
D:\php5\
) to the PATH environment variable (place it in front) and Windows will find all files automatically (restart may be required) -- works fine for me.
P.P.S. Instead of installing it manually, you could use one of the already pre-configured stacks: XAMP, WAMP or similar.
Solution 2:
I fixed the problem. Actually absence of some necessary dll files, not sure which particular file, was the reason and I was trying in the absence of a lot of dll files.
What I did was, I had followed the apache configuration part from teammate 1 and then copied the php5 directory from teammate 2 (who was on a 32-bit system with Windows px). I assumed that the php 5 folder would be same and was wrong. The problem got fixed when I took the php 5 folder of teammate 1.
I checked and found there were many differences in the contents of the two php5 folders, mainly dll files. Absence of necessary dll files must have been the issue because I needed a system restart after taking the correct php5 folder of teammate 1.
Moral of the story -
While copying, don't apply brain and copy from the same place :)