Jump to content


Photo

php 5 and apache 2


  • This topic is locked This topic is locked
8 replies to this topic

#1 doox00

doox00
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 August 2006 - 02:58 PM

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?






#2 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 20 August 2006 - 03:01 PM

You're in the wrong forum.

Anyway, is your php5ts.dll in the same dir as php5apache2.dll?

#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 20 August 2006 - 03:02 PM

Apache 2.2 and php5.2 don't play nice.

See this thread on apachelounge:

http://www.apachelou...9ceb8bc3a24bccf

#4 doox00

doox00
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 August 2006 - 03:40 PM

Apache 2.2 and php5.2 don't play nice.

See this thread on apachelounge:

http://www.apachelou...9ceb8bc3a24bccf


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?



#5 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 20 August 2006 - 07:15 PM

The specified module could not be found.


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?

#6 doox00

doox00
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 August 2006 - 10:34 PM

yeah, they are in the same directory, but I do not have php5_module file.. was told I get it from php.net.. I will look there.


#7 fothers

fothers
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 22 August 2006 - 11:18 AM

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

#8 Newro

Newro
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 23 August 2006 - 09:17 PM

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

#9 wildteen88

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

Posted 23 August 2006 - 09:52 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users