Page 1 of 1

Php Setup help

Posted: Sat Oct 11, 2003 4:10 pm
by greeneel
hello all, I`m having a problem i`m setin up php now after installing apache and mysql and after installing phphe instructions said to type < phpinfo() ?> ..I did this saved it as test.php and proceded to bring it up in http://localhost/test.php , now isntead of getting the page with all that stuff about php i get a page with the same php code in it < phpinfo() ?>..
Can anyone tell me what i did wrong?or what i didn`t do?...

setting up

Posted: Sat Oct 11, 2003 4:11 pm
by phpScott
What OS are you using to setup apache and php on.

phpScott

Posted: Sat Oct 11, 2003 4:14 pm
by greeneel
sorry i forget to put all that, its windows XP pro, php version is 4.3.2 its apache 1.2.28 and mysql 4.0.

Posted: Sat Oct 11, 2003 4:16 pm
by bobby
restart your server

Posted: Sat Oct 11, 2003 4:23 pm
by greeneel
already did, same thing i get again..

httpd

Posted: Sat Oct 11, 2003 4:24 pm
by phpScott
Make sure you have edited your apache's httpd.conf file correctly and restart your apache server.

else let me know and I will send you the instructions that I did up for my company to set up apache, php and mysql on windows XP boxes

phpScott

Posted: Sat Oct 11, 2003 4:42 pm
by greeneel
my file looks ok according to the directions i dunno.. i just restared teh server again buy nothing

Posted: Sat Oct 11, 2003 5:12 pm
by JAM
A shot in the dark here. Did you change this row in the httpd.conf?

Code: Select all

DirectoryIndex index.php index.php3 index.html index.html.var
The first two above is to be added after installing apache/php, and without those PHP might exist, but any php-files are treated as text files...

Posted: Sat Oct 11, 2003 5:22 pm
by greeneel
I don`t understand what u just said JAM, could u give me abit more details ..

Posted: Sat Oct 11, 2003 5:36 pm
by JAM
Sure.
Open up the dir where you installed Apache. In this directory you will find a /conf/ directory containing a file named httpd.conf.

Open it in Notepad or similiar. Around line 323 (if that helps) there is a line looking like:

Code: Select all

DirectoryIndex index.html index.html.var
If it does look like that, try changing it to.

Code: Select all

DirectoryIndex index.php index.php3 index.html index.html.var

Posted: Sat Oct 11, 2003 6:08 pm
by greeneel
Ok man, thx...l

Posted: Sat Oct 11, 2003 6:14 pm
by JAM
Don't thank me yet. Just let us know if it worked for future reference.

Posted: Mon Oct 13, 2003 3:22 am
by twigletmac
One thing to note (don't know if it was a typo in the original code, but

Code: Select all

< phpinfo() ?>
should be

Code: Select all

<?php phpinfo() ?>
otherwise the PHP engine won't recognise the code as being PHP.

Mac