Click to See Complete Forum and Search --> : Error in Apache + PHP 4.0.3pl1 in Win32


Anon
10-22-2000, 05:43 AM
Hello!! I have problem in making php4 work on windows 98 running
Apache 1.2.14. Actually, the PHP that I have downloaded contains the (CGI binary and ISAPI module included, MySQL support built-in, packaged as zip). Now, I hav created a script which contains this code.

#!/php/php.exe -q
<?php
echo "hello, world";
?>

when i view it using my browser, an illegal operation occurs with its title bar as PHP. here's what the dialog contains..

PHP caused an invalid page fault in
module PHP4TS.DLL at 016f:100136ba.
Registers:
EAX=007617b0 CS=016f EIP=100136ba EFLGS=00010206
EBX=100136a0 SS=0177 ESP=0063fc7c EBP=0063fd0c
ECX=a00f26b5 DS=0177 ESI=0065d950 FS=4ecf
EDX=a00f26b9 ES=0177 EDI=0065000c GS=0000
Bytes at CS:EIP:
8b 09 52 8b 56 04 4a 52 8d 54 24 14 52 8b 90 14

... etc..

What's wrong with the code? DId i install PHP or apache correctly. I have followed all the instruction contained in the two software. Anyone can show me a sample php code for windows? Frankly speaking i hav never done any php coding in windows.. pls help..

THANKS in advance..

Juney

Anon
10-30-2000, 03:29 AM
Hey,
It looks like you are running PHP as a CGI then, as you have the #! line at the top of the file. I have my Win98 server configured to see PHP in all directories and I have the .php* extensions redirected to PHP.exe w/o use of the #! line.
The lines that do this are as follows (NOTE: I've got my server configured to run .php3 files with PHP3 and the other extensions to run under PHP4):

ScriptAlias /php3-bin/ "C:/Program Files/webservers/Interpreters/PHP3/"
ScriptAlias /php4-bin/ "C:/Program Files/webservers/Interpreters/PHP4/"

AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php

Action application/x-httpd-php3 "/php3-bin/php.exe"
Action application/x-httpd-php "/php4-bin/php.exe"

A sample pages that works with this Apache/PHP config is as follows (less the ===== lines of course):

=======================================
<?php
echo "PHP is working!!";
?>
=======================================

If you have any questions, please let me know, and i hope this helped =)