Click to See Complete Forum and Search --> : php files show up as plain text


Anon
05-04-2002, 01:32 AM
I have installed apache 1.3 on my win 2000 machine, i have also installed php 4.0. I can access the default apache stuff through the browser by typing http://localhost
(i am not connected to net on win2k machine)it works fine. So I made a file called hello.php which contains <? phpinfo()?> just to test it. That file is in the htdocs folder. so when I put in http://localhost/hello.php all that shows up is <? phpinfo? > as plain text in the browser, instead of the php info that should come up. I have configured everything according to instructions but can't figure it out. anybody know why i am stupid?

jschuur
05-04-2002, 09:29 PM
Did you load the PHP 4 module in your httpd.conf file and define the .php type? It sounds like you may forgotten that. Your configuration file should contain something like this:

LoadModule php4_module modules/php4apache.dll
AddType application/x-httpd-php .php

The exact location of php4apache.dll may vary, this assumes it's in the modules subdir of your ServerRoot (c:/Program Files/Apache Group/Apache e.g.). By default php4apache.dll is in c:/php/sapi.

Also, php4ts.dll must also be copied into something like c:\windows\system32 (or your OS's equivalent).

Note that if you're ever upgrading to Apache 2.x, you will need to use apache2filter.dll instead of php4apache.dll.