Jump to content


Photo

Syntax Error - LoadModule/PHPIniDir


  • Please log in to reply
3 replies to this topic

#1 MatthewB

MatthewB
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 11 May 2006 - 12:32 PM

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".
----------------------------------------------------------

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 May 2006 - 12:57 PM

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.

#3 denflinkelaanehaj

denflinkelaanehaj
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 19 May 2006 - 08:58 PM

[img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Thank you!!!

#4 MatthewB

MatthewB
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 May 2006 - 07:53 AM

Thanks Wildteen88, you are spot on. I uninstalled Apache 2.2.2 and installed Apache 2.0.58, and it is working.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users