Problems with getting apache to load php...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Problems with getting apache to load php...

Post by Radeon »

I hope that it's okey that i post this question here.

I have added this two lines to my httpd.conf file in apache and when i try to start apache after i added this line it says that the requested operation failed... WHy is it so?

LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php .phtml

Thx for any help i get..
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

windows-version?
apache-version?
php-version?
Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Post by Radeon »

Windows 2000 Professional
Apache 2.0.43
PHP 4.2.3
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

then you've used the wrong .dll
use php4apache2.dll instead
Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Post by Radeon »

Apache still wont start :(

Requested operation failed.

I shutdown the apache server. added the twho lines and i try to sytart it again but ut wont start. And even if i remove the two lines it still wont start even though it did start after i installed it...

Should i use an older version of apache instead?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I had a apache2 (2.0.36) on my w2k but turned back to 1.3 since I wanted the php-source-highlighting feature.
Apache2 is still under development and some features/interfaces are subject to change :? Took me days to get some modules to work after an update.
At the moment apache 1.3 is sufficient for me.....
Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Post by Radeon »

I just installed apache 1.3.27 and i added all line as said in this manual: http://www.php.net/manual/en/install.apache.php

But then when i start my apache server it sais that it can't find the c:/php/sapi/php4apache.dll

Should i use CGI binary instead of Module?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

did you install php in c:/php/?
search for php4apache.dll and type that path ;)
Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Post by Radeon »

Yes, php is in c\php and the .dll file is there to in exactly that directory...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

does it only complain about missing php4apache.dll?
maybe it cannot find php4ts.dll
Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Post by Radeon »

Ïf thats the problem how sould i do so that it finds that file?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

install.txt
You need to ensure that the dlls which php uses can be found. The precise
dlls involved depend on which web server you use and whether you want to
run php as a cgi or as a server module. php4ts.dll is always used. If you are
using a server module (e.g. isapi or apache) then you will need the relevent
dll from the sapi folder. If you are using any php extension dlls then you
will need those as well. To make sure that the dlls can be found, you can
either copy them to the system directory (e.g. winnt/system32 or
windows/system) or you can make sure that they live in the same directory
as the main php executable or dll your web server will use (e.g. php.exe,
php4apache.dll).
In the .zip-Version of php for windows is a php-cli.exe
open a command line and try to execute it. Does this work?
e.g.

Code: Select all

echo "<?php phpinfo() ?>" | php-cli.exe
jjj3
Forum Newbie
Posts: 2
Joined: Sat Nov 02, 2002 10:38 am

Post by jjj3 »

Hello,

Win2K Apache 4.2.34 PHP 4.2.4-dev

Your test

echo "<?php phpinfo() ?>" | php-cli.exe

works for me from the dos window! Thanks! :D

However, I have not been able to invoke the phpinfo display from my browser. It always responds with file not found.

I have added the "AddType application/x-httpd-php .php .html .inc" line to httpd.conf as per the install.txt documentation. And doc_root has been set up in the php.ini file as well.

The testphp.php file containing "<?php phpinfo() ?>" is located off document root. My index.html works fine, but the testphp.php file is always not found. :cry:

Any ideas? :idea:
jjj3
Forum Newbie
Posts: 2
Joined: Sat Nov 02, 2002 10:38 am

Post by jjj3 »

:oops:

Looks like testphp.php got named testphp.php.txt.

Doh!!

Working now!

Yipee!
:D
Radeon
Forum Newbie
Posts: 11
Joined: Thu Oct 31, 2002 6:26 am
Contact:

Post by Radeon »

Ok, i'll try what u guys said when i get time :P

Thx for all the wonderful help :wink:
Post Reply