Page 1 of 2

Problems with getting apache to load php...

Posted: Thu Oct 31, 2002 6:26 am
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..

Posted: Thu Oct 31, 2002 6:57 am
by volka
windows-version?
apache-version?
php-version?

Posted: Thu Oct 31, 2002 7:23 am
by Radeon
Windows 2000 Professional
Apache 2.0.43
PHP 4.2.3

Posted: Thu Oct 31, 2002 7:50 am
by volka
then you've used the wrong .dll
use php4apache2.dll instead

Posted: Thu Oct 31, 2002 8:13 am
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?

Posted: Thu Oct 31, 2002 8:20 am
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.....

Posted: Thu Oct 31, 2002 9:02 am
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?

Posted: Thu Oct 31, 2002 9:15 am
by volka
did you install php in c:/php/?
search for php4apache.dll and type that path ;)

Posted: Thu Oct 31, 2002 10:45 am
by Radeon
Yes, php is in c\php and the .dll file is there to in exactly that directory...

Posted: Thu Oct 31, 2002 11:11 am
by volka
does it only complain about missing php4apache.dll?
maybe it cannot find php4ts.dll

Posted: Fri Nov 01, 2002 7:45 pm
by Radeon
Ïf thats the problem how sould i do so that it finds that file?

Posted: Fri Nov 01, 2002 8:38 pm
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

Posted: Sat Nov 02, 2002 10:38 am
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:

Posted: Sat Nov 02, 2002 1:51 pm
by jjj3
:oops:

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

Doh!!

Working now!

Yipee!
:D

Posted: Sat Nov 02, 2002 7:36 pm
by Radeon
Ok, i'll try what u guys said when i get time :P

Thx for all the wonderful help :wink: