Click to See Complete Forum and Search --> : PHP4 Win95 Apache


Anon
09-21-2000, 01:55 PM
Can someone please point me to the explanation for the settings in the Win95 Apache 1.3.9 httpd.conf file are described for PHP4?.

I seem to be able to get PHP4 to run from a DOS command, but from my browser, it either does not translate the PHP file, can't find the PHP file unless it is in the cgi-bin directory or generates an internal server error.

Thanks.

Anon
09-21-2000, 07:09 PM
Looks as though your httpd.conf is not set up correctly, or you are accessing the PHP file wrongly in the browser.

Put the php file in the htdocs folder in your apache directory. Then type into a browser "http://localhost/test.php"

where "test.php" is the name of the php file. So the htdocs directory is the point that acts as your server root. Don't try running php files from the cgi-bin because they dont belong in there.

If you still cant see anything php-related, then it is your httpd.conf that is wrong.
Show the commands you have altered in your httpd.conf and I can deduse the problem.

Anon
09-22-2000, 02:20 PM
Thanks. I have been very impressed by the quality of help on this forum.

I actually did get it to work! No thanks to the PHP4 installation directions or to The PHP4 Bible (p 43 - 45) which seemed to think we should not try and discussed only the isapi approach.

However, the book PHP fast & easy web development (p 33 - 35 presented the information that even I could get to work). I think it is the absence of the information in the installation directions that is causing the confusion.

Here is way I did and it works for me:
Added these lines in the apache httpd.conf file

ScriptAlias /cgi-bin/ "H:/Apache Group/Apache/cgi-bin/"

ScriptAlias /php4/ "H:/php4/"

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps (I have no idea why this is here)

Action application/x-httpd-php /php4/php.exe

I also:
Extracted the php-4.0.2-Win32.zip file to H:\php4

Copied and renamed php.ini-dist to php.ini and placed in the c:\windows directory

Copied php4ts.dll to c:\windows\system ( msvcrt.dll was already there )
--------------------
Thanks for you offer to help - it encouraged me to try again. Looks pretty nifty.