Page 1 of 1
Setting up PHP
Posted: Thu Feb 26, 2004 4:27 pm
by dydor
I've set up MySQL, Apache, and PHP4 on Windows 2000. Everything seems to be installed, and the first two are working. PHP is installed also, but Apache does not parse my PHP script. The test-file phpinfo.php produces the expected output, but none of my 'hello world' type efforts do.
Is the problem most likely in the Apache httpd.cof file, or is it maybe my script that is wrong?
Sorry if this is a too simple question!
Posted: Thu Feb 26, 2004 4:30 pm
by infolock
umm.. let's see
#1. are you putting the php files in the HTDOCS directory ?
#2. When you try to load a php file, does it only show the code?
#3. Are you getting any errors?
#4. Is apache loading ok ( and not erroring out) ?
Posted: Thu Feb 26, 2004 5:11 pm
by dydor
Thanks for the reply. Apache is starting and working fine. My file hello.php is displaying the html in the browser, but leaving out the part enclosed in the <? php ?> tags. It's in the HTDOCS directory, and I'm not getting any errors.
And Albert's right as usual!
Posted: Thu Feb 26, 2004 7:42 pm
by Deemo
this might seem a bit stupid, but its always the easy things that get u
when u open up the page in the browser, are you opening it straight from explorer? if u are, it wont work. you should use the localhost ip address, of if you arent on the computer itself, the ip address of the server
localhost ip address: 127.0.0.1
when u view thru explorer, it doesnt activate apache, but when u view through the ip address, then it is activated
also, since the test file phpinfo.php is in your htdocs folder, you will need to say
http://127.0.0.1/phpinfo.php
to make sure that it goes to that page
hope this helps
Posted: Fri Feb 27, 2004 12:36 am
by dydor
Thanks Deemo. I've tried it both ways, the phpinfo.php file works, but my 'hello world' type scripts don't.
Posted: Fri Feb 27, 2004 3:36 am
by Dr Evil
Could you show us your Hello World type script please ?
Is it in the correct folder (I think you might have been asked before)
Dr Evil
Posted: Fri Feb 27, 2004 7:10 am
by jigaruu
Do one thing try to browse some other already working file, then it wils show you the exact error and u can then track out the exact problem.
Posted: Thu Mar 04, 2004 11:02 am
by dydor
Many thanks all! I got it working with the following address -
http://127.0.0.1/hello.php
I also set the ServerName in the apache conf file to 127.0.0.1, which it seemed to like - don't know if it's strictly necessary......
Thanks again.