I installed Apache2.2 on "C:\Apache2.2" directory, using windows installer.
It works OK. (I can do these functions with out an error -> stop,start,restart)
Now, i'm going to installe PHP 5.1.4 manually, which will work with Apache.
I extract the content of "php-5.1.4-Win32.zip" to C: drive and rename that folder as php. Now, those php file(All .dll files & others) are resides in "C:\php"
Then i rename the "php.ini-recommended" as "php.ini" & copy that into the C:\WINNT folder.
Also copied the "php5ts.dll" to C:\WINNT
Now i'm going to configure "httpd.conf"
i put these lines into that file, in correct places-->
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
But when i do that, I CANNOT Restart the Apache ???
It gives this ERROR...
'The requested operation has failed'
--------------
I think the error is coming from this line...
LoadModule php5_module "c:/php/php5apache2.dll"
The path is correct... There is a file called "php5apache2.dll" in c:/php
when i comment that line,
#LoadModule php5_module "c:/php/php5apache2.dll"
i can do the operations with apache.(start,stop.restart)


I didn't do any changes to the php.ini
Changes are only made with httpd.conf
Do i need to insert a line like this to the httpd.conf
PHPIniDir "C:/php"
If so,... to where it should insert !!
Please help me to configure this...
(O/S using is Win2000 prof. with service pack 4)

(I did the same procedure with winxp sp-2. But it gives the same ERROR..)

Dani AI

Generated

A practical diagnosis and short checklist for and anyone hitting the same failure: when Apache refuses to start after you enable PHP, the root cause is almost always a binary-compatibility or dependency problem, not a typo in httpd.conf. As suggested, the Apache error log (and Windows Event Viewer for service-start failures) is the single most useful first stop — it will usually record whether a module failed to load and why.

Quick troubleshooting steps to follow in order:

  • Read the exact error entry in Apache’s error log and the System event log right after a failed start. Note the module path and any “missing” DLL messages.
  • Confirm the PHP module binary is built for your exact Apache build and for your OS architecture (32-bit vs 64-bit). Mismatched builds fail silently at load time.
  • Check the module’s external DLL dependencies with a dependency-inspection tool so you can spot a missing Visual C++ runtime or other required DLL.
  • Avoid copying PHP runtime DLLs into Windows system folders as a first fix; instead add the PHP directory to the system PATH or place needed DLLs next to Apache’s binaries to prevent version conflicts.

Fix options (pick one that fits):

  • Install a PHP build that contains an Apache module compiled against your Apache version. Several forum members pointed this route out and confirmed it works in practice.
  • Run PHP via FastCGI (mod_fcgid) instead of the Apache module to avoid strict binary compatibility requirements.
  • Use a prepackaged stack if you want everything matched automatically; alternatively, downgrade Apache only if you cannot obtain a compatible module.

Final checks: start Apache from a console or inspect logs immediately, then verify PHP is reachable. Credit to contributors in this thread — and for the “module for this Apache” lead, for the downgrade note, and / for the packaged-stack suggestion — and to and for steering you to the logs and config.

Recommended Answers

All 11 Replies

I am very much sure that the error is not by adding the line LoadModule php5_module "c:/php/php5apache2.dll". If you are using Apache 2.X, we need to add “c:/php/php4apache2.dll" instead of "c:/php/php4apache.dll".

U need to add more one line in the "http.conf file
Simply search for the line in the file that begins with a "DirectoryIndex" and add "index.php" to the list of files on that line.
For Eg: change it to DirectoryIndex index.php index.html

The next time you access "localhost" or "localhost/directory/" without a filename, Apache will deliver "index.php" if available, or "index.html" if "index.php" is not available.

Then test for PHP

Create a PHP file with the following line:
<?phpinfo()?>

Save the file with the extension php(Eg:testphp.php) and save the file in your Apache htdocs directory(i.e c:\program files\apache group\apache\htdocs


access the file you just created by typing http://localhost/testphp..phpinto in your browser.

U shd able to see all the information about your PHP setup.

I hope i have answered ur question...

Good luck then...

Can you post a copy of your httpd config file

If you look in the error log in will have a more usefull error message.

Don't bother for all this configurations,,,,,,,somebody is already doing it for you........

google XAMPP and install it, look the documentation and change the passwords as suggested, you are all set........

It is opensource and free and preconfigured php, mysql, pear, filezillaFTP, Mercury Mail server and lot more.........

Good Luck.........

I came to this forum trying to find the solution for the same exact problem. I realize the original poster probably already figured a way out, but for future people with the same problem I recommend uninstalling apache 2.2 and getting apache 2.0- it worked for me. According to this , apache 2.2 doesn't work with php5 (it needs a beta 5.2 version or something..)

What you need is php5apache2_2.dll, which is compatible with Apache 2.2. The file is available in the PHP 5.x snapshot at

there is WAMP server or XAMPP server which will configure php, apache, and mysql for you

bobodunno, you're a legend. :mrgreen::cheesy::mrgreen:
For anyone experiencing this error, this is what I did by following the link below which solved the issue (running on WinXP prof sp2):
1. Follow the link below
2. Download the latest WIN32 package snapshop which is a zip file.
3. Extract ONLY the php5apache2_2.dll file from the zip archive into your PHP install folder (I also extracted php5apache2_2_filter.dll, not sure if I needed to)
4. Double check your PATHs in httpd.conf are correct, save it and then restart Apache2.2

What you need is php5apache2_2.dll, which is compatible with Apache 2.2. The file is available in the PHP 5.x snapshot at

bobodunno ... that was a great . Thanks for the help.

Apache 2.2.x does not support the regular php. you need to get the snaps version of php from . follow the instructions and install and it should work fine
Hope it works well for you...:)

What you need is php5apache2_2.dll, which is compatible with Apache 2.2. The file is available in the PHP 5.x snapshot at

I know this is an old post, but thanks anyway wherever you are.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.