Php Setup help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

Php Setup help

Post 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?...
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

setting up

Post by phpScott »

What OS are you using to setup apache and php on.

phpScott
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

Post 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.
bobby
Forum Commoner
Posts: 27
Joined: Sat Oct 04, 2003 4:00 pm
Location: usa
Contact:

Post by bobby »

restart your server
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

Post by greeneel »

already did, same thing i get again..
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

httpd

Post 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
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

Post by greeneel »

my file looks ok according to the directions i dunno.. i just restared teh server again buy nothing
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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...
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

Post by greeneel »

I don`t understand what u just said JAM, could u give me abit more details ..
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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
User avatar
greeneel
Forum Commoner
Posts: 47
Joined: Wed Jul 30, 2003 5:19 pm

Post by greeneel »

Ok man, thx...l
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Don't thank me yet. Just let us know if it worked for future reference.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply