Jump to content

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.

System:
WinXP Pro latest SP
Apache 2.2.2
PHP5

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:
----------------------------------------------------------
httpd.conf:
1) LoadModule
LoadModule php5_module c:/php5/php5apache2.dll

2) PHPIniDir
#PHPIniDir
PHPIniDir "C:/php5"
Also tried:
#PHPIniDir
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"
and
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">

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

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
Win32DisableAcceptEx
----------------------------------------------------------
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".
----------------------------------------------------------
Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.