Page 1 of 1

[Solved] I'm lost without PHP!

Posted: Wed Apr 14, 2004 8:34 pm
by Gen-ik
Solved

After searching the net for an hour I found the answer to the following problem. For some odd reason I had to manually add the PHP mime-type into the conf/mime.types Apache file!!! You would have though they would have added it already!

Anyway.. here's the mime-type for PHP just in case anyone else has the same problem.

application/x-httpd-php

**********************************************************
I picked up a brand-spanking-new PC this weekend and it's all working fine (which is nice) but I can not for the life of me get PHP running with Apache again!! It worked fine on my last system and I don't know what I'm doing wrong... I running Apache on Windows XP by the way.

I've set-up the Apache httpd config file to load up the relevant PHP related files and it loads up fine with no errors so I'm guessing everything is ok with Apache. However, when I try to run a PHP file I get the PHP code being displayed and not executed.

I've set-up Apache to open index.php files in exactly the same way as I did on my last system.

PLEASE HELP! I LOST WITHOUT PHP!!! :cry:

Posted: Wed Apr 14, 2004 8:50 pm
by d3ad1ysp0rk
Make sure you set your directoryindex to the folder you'd like to use.

Posted: Wed Apr 14, 2004 9:24 pm
by Gen-ik
Yeah that's the strange thing.. I've gone through the conf file several times to make sure all of the paths etc are correct (just done it again) and there's still no joy unfortunatly.

I'm confused.

Posted: Wed Apr 14, 2004 9:36 pm
by Gen-ik
I've just tried a bog-standard HTML page and that's also being displayed as text and not HTML... so it's not just a PHP thing.

I can view the htdocs folder fine by going to http://127.0.0.1/ so Apache is working in that respect.

Posted: Wed Apr 14, 2004 9:46 pm
by d3ad1ysp0rk
Try rebooting? (computer and/or apache).

Posted: Wed Apr 14, 2004 10:13 pm
by Gen-ik
Yep, tried that as well.. still not working.

Posted: Wed Apr 14, 2004 10:22 pm
by d3ad1ysp0rk
So what do you get when you load 127.0.0.1?
Index of/?

If so, what happens when you click on .txt files?

Posted: Wed Apr 14, 2004 10:27 pm
by Gen-ik
I made a little test page with a bit of HTML and a bit of PHP chucked into it and the following is what gets display...

<b>Hello</b><br />
<?php echo "BOB" ?>
<? echo "BOB" ?>

...and that's from http://127.0.0.1/index.php

If I try creating a simple HTML page I get this...

<b>Hello</b>

...from http://127.0.0.1/index.html

Apache for some reason isn't executing the files as HTML and/or PHP but is displaying the 'source code'. It seems to be treating them as plain/text files for some reason.