Click to See Complete Forum and Search --> : Latest Apache + PHP on XP problems...


pinkbike
02-13-2002, 01:50 AM
Why is this always such a hassle? I've installed Apache and PHP on many a windows machine through the years and everytime I do a new install it's a pain in the ass.

I just downloaded the latest Apache 1.3.23 and Latest PHP 4.1.1 . Now I had my old httpd.conf file from previous installs and if I use it seems thing to work fine.
But I decided to try and use the stock one that comes with the Apache install. To my surprise is a but different.
Now the line to fire up the PHP module is
LoadModule php4_module c:/php/sapi/php4apache.dll right? I would normally stick it under all the other LoadModule calls in the httpd.conf, add the type AddType application/x-httpd-php .php , restart the service and away we go.

but no. This does not even load the module. How come?
I played with a few things and I see now there are a bunch of AddModule calls under all the LoadModule definitions. If I place the LoadModule for php under those, it seems to load correctly.

Why is this all so hard. Why does one have to spend a bunch of time to figure crap like that out.
Also in the previous versions of Apache the PHP Alias and AddType settings were commented out....now they are not even there to give you a hint. What's up with that?

Plus PHP does not even work on XP - Arghhh! I new I should of not upgraded from 2K.
No, it does not work.
http://bugs.php.net/bug.php?id=14474

gardner1
02-13-2002, 04:15 PM
I'm able to use it... =)

Don't know why or how other than perserverance... have you tried...


LoadModule php4_module "c:\php\sapi\php4apache.dll"

use the backslashes and quote marks... Might work.. has for me =)

gardner1
02-13-2002, 04:16 PM
btw, using apache 1.3.22 and php 4.1.1

the 1.3.23 might have added some quirks

/shrug

pinkbike
02-13-2002, 04:41 PM
Thanks, Richard.

I did finally get it to work. Turns out you have to place
LoadModule php4_module "c:\php\sapi\php4apache.dll"

After both the the Load and Add module stuff that is in the httpd.conf file.
Like this

LoadModules (different apache modules)
LoadModules (different apache modules)
LoadModules (different apache modules)
LoadModules (different apache modules)LoadModules (different apache modules)
LoadModules (different apache modules)

AddModule (different apache modules)
AddModule (different apache modules)
AddModule (different apache modules)
AddModule (different apache modules)
AddModule (different apache modules)

LoadModule php4_module "c:\php\sapi\php4apache.dll"


AND NOT LIKE THIS

LoadModules (different apache modules)
LoadModules (different apache modules)
LoadModules (different apache modules)
LoadModules (different apache modules)LoadModules (different apache modules)
LoadModules (different apache modules)

LoadModule php4_module "c:\php\sapi\php4apache.dll"

AddModule (different apache modules)
AddModule (different apache modules)
AddModule (different apache modules)
AddModule (different apache modules)
AddModule (different apache modules)

It was driving me crazy. It's not LIKE it says to add it there in any of the PHP or Apache documentation.
But I guess users are expected tobe mind readers or at least be lucky to put it in the last place. :) I'm usually unlucky.

gardner1
02-13-2002, 05:02 PM
LMAO! tell me about it... I just cookies to finally work on my test machine (XP,Apache,PHP,MySQL) after a significant loss of hair!!

I read a note re: Win on the php.net site, explaining and half apologetic that support for configuring for Win is scant, and mostly (you're looking at it!...) user based... as more momentum grows, perhaps it will begin to gain more favor.

Obviously there are +'s and -'s to running on Win, but Apache+PHP+MySQL I would think is at least more secure than IIS, and would hope to god that it would require less overhead... Dunno, though.. would have to run benchmarks to see.

For me, I just use it for personal edification. I work in Network Ops for a large company, but I'm currently schmoozing to get into the Web Dev group w/ our corp.

Networking is cool, and I've learned one heck of a lot, but I like to "tinker"

=)

pinkbike
02-13-2002, 05:23 PM
Ok I'm not going to start to rant again but isn't PHP big enough now that it should be at least mentioned in the httpd.conf file. Maybe a few comments like "Hey if you want to enable php - uncomment this here, and/or place this here"

Myself I run apache, mysql, php on my XP laptop just for development. Developed a few sites for fun like www.pinkbike.com and www.biglines.com and they all run on FreeBSD which I can't say anything bad about - I can't remember when the last time was that that server was rebooted(years) and it gets like 30 million hits a month and pumps out around a terabyte each month.

Day job I do hardware and firmware design so all this web stuff is just a hobby.

In any case, I wish it all was easier. But I guess a good place to start is here and share the knowledge that I have learned over countless sleepless nights. :)
And of course get the info from everyone elses hair pulling sessions.
:)

andrin
02-13-2002, 10:44 PM
Iīm running Apache 1.3.20 and there it says:

# For example, the PHP 3.x module (not part of the Apache distribution - see
# http://www.php.net) will typically use:
#
#AddType application/x-httpd-php3 .php3
#AddType application/x-httpd-php3-source .phps
#
# And for PHP 4.x, use:
#
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps

Is this not clear enough? :-)

/Andrin

pinkbike
02-13-2002, 11:40 PM
Download the LATEST Apache and in any of the httpd.conf files that it installs there is no mention of this.

I know that it was in the previous versions. But like I said, this is the latest Apache 1.3.23

Why was that removed I'm not sure but I'd like to know the reasoning behind it.
I'm sure all the users out there that are trying to install this for the very first time are going to have a few more problems now.

Anyway thanks. :)

andrin
02-13-2002, 11:57 PM
Well as I said, I got 1.3.20 :-) If this is the case that the people at Apache has removed it Iīm confused. Why take something thatīs good and make it less good??? I donīt understand.

/Andrin ?:-)

gardner1
02-14-2002, 03:03 AM
Perhaps they are planning the rollout of a Customer Support line, and figure they needed some built in work for themselves...

Bwahahhahahaha

Anon
03-01-2002, 07:16 AM
System XP Pro
Apache 1.3.23
PHP 4.1.1

After the LoadModule and AddModule directives add the following lines to your apache http.ini

# PHP 4 Module Placement

LoadModule php4_module "c:\php\sapi\php4apache.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

To stop IE from progressively reloading any php pages, turning HTTP1.1 Off (Tools,Internet Options, Advanced),in your browser seems to makes the problem disappear. Hope this helps.

Anon
03-01-2002, 07:21 AM
Apologies references made to http.ini should of course have been httpd.conf.

vildan
05-08-2002, 11:04 AM
Config:

- php 4.1.2
- apache 4.0.35
- win xp


Hello,


I am having same problem with my server as discussed above. SO i have tried to resolve my problem by trying 2 do as recommended above. But,

I am unable to load php4apache.dll module and run apache.

Apache won't run with:

LoadModule php4_module "C:\PHP\sapi\php4apache.dll"

File is located in that directory.

For some reason my version of PHP didn't installed and sapi folder nor php4apach.dll on the system.

I am also unable to find php4apache.dll for php 4.1.2 so I have tried with php4apache.dll from php 4.2.0 distribution, but that doesn't work.

Any ideas ?


-Vildan

Anon
07-19-2002, 06:05 AM
Scary things.. :-)
I ran into similar problems too, and gues what it's a known .. error .. not a bug (according to information from php.net) .. it shouldn't matter where you put your LoadModule and AddModule statements, all you need to do is to copy the ?:\php\phpts.dll file to your \winnt\system32 directory ... whoa.. and than it just starts "automagicly"..

http://news.php.net/article.php?group=php.bugs&article=9066