Reinstalling PHP/Apache -- httpd.conf syntax error [solved]

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Reinstalling PHP/Apache -- httpd.conf syntax error [solved]

Post by s.dot »

Code: Select all

#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so

# For PHP 5 do something like this:
LoadModule php5_module "C:/php/php5apache2.dll"              <---- LINE 117
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"
Error Message:
Apache wrote:httpd.exe: Syntax error on line 117 of C:/apache/conf/httpd.conf: Cannot load C:
/php/php5apache2.dll into server: The specified module could not be found.
Note the errors or messages above, and press the <ESC> key to exit. 20...
The path to the module is indeed C:\php\php5apache2.dll
I haven't done this for a while, so it's probably a silly error. :P

Apache 2.2.3 / PHP 5.1.6
Last edited by s.dot on Sun Sep 03, 2006 2:28 am, edited 1 time in total.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

is php5apache2.dll really compiled for apache 2.2 and not for apache 2.0?
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

copy the dll into the windows or the windows/system folder... that usually solves the problem for me...
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

volka wrote:is php5apache2.dll really compiled for apache 2.2 and not for apache 2.0?
Switching to 2.0.59 fixed this problem. ;) Thanks!
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
meatwear
Forum Newbie
Posts: 1
Joined: Wed Sep 20, 2006 4:49 pm

Post by meatwear »

If you want to stick with apache 2.2 then there is a fix available: http://www.apachelounge.com/

Here's the readme from Steffen (thanks)

# binary by: Steffen
# Mail: info@apachelounge.com
# Home: http://www.apachelounge.com/
#
#
# Runs only with PHP 5.1.0-5.1.6 and Apache 2.2.0-2.2.3 !!

# Install:

- Copy php5apache2.dll to your php folder (eg. c:/php)

- Copy httpd.exe.manifest to apache2/bin

- Finally install the Visual C++ 2005 Redistributable Package (the binary is build with VC 2005).
Download it from:
http://www.microsoft.com/downloads/deta ... laylang=en



# Add to your httpd.conf

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

Note: Remember to substitute the c:/php for your actual path to PHP in the above examples.


For extra info see also : http://www.apachelounge.com/forum/viewtopic.php?t=570


Enjoy,

Steffen
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

That's not all. You need to download the php5apache2.dll build for apache2.2 mentioned in this how-to.
http://www.apachelounge.com/download/ wrote:php5apache2.dll-php5.1.x.zip 24 Aug '06 14K
apache2handler for Apache 2.2.x and PHP 5.1.0-5.1.6
And (only) because the guy who made this (unofficial) build used visual studio 2005 and some dependencies were compiled in you need the 2005 redistributables.
[don't get me wrong, that's not bad. but it is different from "you only have to copy two files to get it working" ;)]
beth
Forum Newbie
Posts: 1
Joined: Fri Apr 18, 2008 8:53 am

Re: Reinstalling PHP/Apache -- httpd.conf syntax error [solved]

Post by beth »

Hi I was having exectly the same problem I changed:

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

instead and it worked fine, no idea why but it did.
Post Reply