Jump to content


This topic is now archived and is closed to further replies.


Syntax Error - LoadModule/PHPIniDir

Recommended Posts

I've done a pretty exhaustive search on this forum and have made major progress, unfortunately, I'm running into a roadblock that I hope someone may recognise and suggest a solution.

WinXP Pro latest SP
Apache 2.2.2

I installed Apache 2.2.2 from the MSI and PHP5. Apache started, displayed html, but php did not parse. I made the following configuration changes (thanks to Wildteen88 and others) as displayed below.

Apache fails to start. When I try 'Test Configuration' I receive the following error:
"httpd.exe: Syntax error on line 115 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/PHP5/php5apache2.dll into server: The specified module could not be found."

I have verified that the file, php5apache2.dll, is located in C:\PHP5.

If I comment out the LoadModule line, I received the following error:
"Syntax error on line 118 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Invalid command 'PHPIniDir', perhaps misspelled or defined by a module not included in the server configuration.".

Commenting out this line allows Apache to start, but phpinfo doesn't parse. It just downloads a blank page.

Any suggestions, am I being really dim and missing something?

Configuration Log:
1) LoadModule
LoadModule php5_module c:/php5/php5apache2.dll

2) PHPIniDir
PHPIniDir "C:/php5"
Also tried:
PHPIniDir "C:/WINDOWS" (PHPIniDir error received). Change commented out.
Also tried:
PHPIniDir "c:/php5/" (PHPIniDir error received). Change commented out.

3) DocumentRoot
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">

4) DirectoryIndex
<IfModule dir_module>
DirectoryIndex index.html index.html.var index.php

5) AddType
AddType application/x-httpd-php .php .phtml .html .php3
AddType application/x-httpd-phps .phps

6) MMAP, Sendfile and AcceptEx
EnableMMAP off
EnableSendfile off
PHP Changes
1) php.ini-recommended changed to php.ini and moved to c:\WINDOWS
2) php5ts.dll moved to c:\WINDOWS\SYSTEM. Later moved to c:\windows\system32.
3) DocRoot ammended in php.ini to "doc_root = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs".

Share this post

Link to post
Share on other sites
PHP is not compatible with Apache 2.2.2. Therefore you are getting those errors. I would recommend you to downgrade Apache to version 2.0.58 as PHP5 is compatible with that version.

Share this post

Link to post
Share on other sites
Thanks Wildteen88, you are spot on. I uninstalled Apache 2.2.2 and installed Apache 2.0.58, and it is working.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.