Jump to content

php 5 and apache 2


Recommended Posts

I just setup a windows 2003 web edition server, remove iis, installed apache, which was working fine, and then got and installed php 5.  Now though when I start the apache server it fails and in the event log it says

The Apache service named  reported the following error:
>>> httpd.exe: Syntax error on line 482 of E:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load E:/php/php5apache2.dll into server: The specified module could not be found

The path is right though, I added e:\php into my windows path as well.

these are the lines I added into my httpd.conf file per the install.txt for php

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


any ideas what I am doing wrong?




Link to comment
Share on other sites

[quote author=hitman6003 link=topic=104951.msg418887#msg418887 date=1156086136]
Apache 2.2 and php5.2 don't play nice.

See this thread on apachelounge:

http://www.apachelounge.com/forum/viewtopic.php?p=3019&sid=4fa309c2778bca8889ceb8bc3a24bccf
[/quote]

I followed that exactly and apache still fails to load, says
cannot load E:/php/php2apache2.dll into server: The specified module could not be found.

I was just looking, there is no php5_module in the apache2.2/modules directory.  where do I get this?

Link to comment
Share on other sites

[quote]The specified module could not be found.[/quote]

If you don't keep php5ts.dll and php5apache2.dll in the same dir, that is exactly the message you get. So I'll ask you again; are they in the same directory?
Link to comment
Share on other sites

As you are using Apache 2.2, the dll you need is not in the latest PHP release.  If you download a later version of php (5.2) from http://snaps.php.net there will be a different dll for apache, the php5apache2_2.dll.  Use that dll in the apache configuration LoadModule and it should work.

Luke
Link to comment
Share on other sites

ok so what u need to do get working apache 2.2 n php 5.2.x or whatever is last on web :)...i did this same few days ago..sorry for my english i am not from english speaking country...
so u have got  httpd.conf in apache...

u have to have got right few things there
DocumentRoot "whatever where is your source directory with html and php files"
few lines below it is

# This should be changed to whatever you set DocumentRoot to.
#
<Directory "same directory like above">

after find this line below again:
    AddType application/x-gzip .gz .tgz

and write under that this without my notices after slashes //

ScriptAlias /php/ "c:/php/"                                                                //directory where is you php look at the SLASHES  /
AddType application/x-httpd-php .php .php5                                        //extension which your files could have
Action application/x-httpd-php "/php/php-cgi.exe"                                //this is compilator which get your code to work
SetEnv PHPRC "C:/php"                                                                    //something but again with directory with php

<Directory "C:/php">                                                  //write this stuff as well it is for direcory where is php
  AllowOverride None                                                  //as u can c there is some permission stuff without that is apache not
  Options None                                                        //working 
  Order allow,deny
  Allow from all
</Directory>


ok thats it

now php.ini
doc_root = "path to your document directory same like in apache"  with normal backslash  c:\xxx
below that few lines find
extension_dir = "c:\php\ext"                    //its some extension libraries in there change it for your path
thats it..
now like u writing u have got win 2k3 so i think it s same like XP in directory structure so u have to copy php5ts.dll to c:\WINDOWS
or c:\WINDOWS\SYSTEM32...copy to both u can play with it later..
tahts pretty much it...
dont forget run apache when u trying to test your code
n....have fun...step by step...
ou n dont put in apache conf file that php5apache2.dll like load module cos first -all module have different extension
second-u dont need it when u not running php like a module of apache...
it s just any issue of security about that directory parameters as i found out but...
hmm n php5apache2.dll is in the root directory of php...where is php.ini and php5dt.dll...
did u download that zipped version of php???just unpack it to folder and go...dont install anything (except apache :D)
hope i helped....
Link to comment
Share on other sites

This has been solved in another thread in the Apache Help forum. Umm didn't realise doox00 posted another version of the same problem in a different forum.

Thread closed. doox00 if I've made a mistake please post in the PHPFreaks.com Questions, Comments, & Suggestions forum for this thread to be reopened.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.