when I type on the URL: http://localhost/phptest.php....

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

when I type on the URL: http://localhost/phptest.php....

Post by christian_phpbeginner »

Hello....

I don't know what happened, I've followed the instructions, read the how to install PHP manually, or using Window Installer. But I did install it manually to work with Apache Web Server.

The problem is that....

I have created a phptest.php, and the code is shown below:

<HTML>
<HEAD>
<TITLE>PHP Testing</TITLE>
</HEAD>
<BODY>
<?php echo "<p>Hello, world!</p>"; ?>
</BODY>
</HTML>

Then, I go to my browser, and type http://localhost/phptest.php ...it shows me those HTML tags and codes, just like I wrote it in my notepad.

<HTML>
<HEAD>
<TITLE>PHP Testing</TITLE>
</HEAD>
<BODY>
<?php echo "<p>Hello, world!</p>"; ?>
</BODY>
</HTML>


What's wrong ? Can somebody help ?

Thanks a lot,
Christian
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

I can think of 2 possible reasons:

1. You forgot to restart Apache.
2. You didn't install it properly. Which instructions did you use?
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

Oren wrote:I can think of 2 possible reasons:

1. You forgot to restart Apache.
2. You didn't install it properly. Which instructions did you use?
Hello Oren !

Thanks for the reply, but I did restart the Apache. Maybe I didn't install it properly, or maybe I did miss something.....but I don't know what I've missed....I am sure that I have followed the instructions.

I have followed the instructions from http://www.php.net/manual/en/install.windows.manual.php

Please help me to install it first. Do you also know how to uninstall PHP ? I have the PHP 5.1.2 which I have downloaded 2 months ago, but now it has a new release PHP 5.1.4.

Regards,
Chris
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

Run this and see what are the results:

Code: Select all

<?php phpinfo(); ?>
P.S
Use

Code: Select all

 and [code]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

ok wrote:Run this and see what are the results:

Code: Select all

<?php phpinfo(); ?>
P.S
Use and
I don't think that's going to work if PHP isn't working ;)

I'd check the paths you've given in php.ini for the locations of the php dll file and make sure the exist. Is it possible you've editted the wrong httpd.conf ?
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

ok wrote:Run this and see what are the results:

Code: Select all

<?php phpinfo(); ?>
P.S
Use and

hi !....I've tried it, and the result was exactly what I have typed in the .php document, which was:

Code: Select all

<HTML>
<HEAD>
<TITLE>PHP Testing</TITLE>
</HEAD>
<BODY>
   <?php phpinfo(); ?> 
</BODY>
</HTML>
What happened actually ?
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Did you copy the needed files into your system directory? (for Win XP that would be 'system32' and for Win 98 that would be 'system')
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

The easy way is to install wamp(5): http://www.en.wampserver.com/
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

ok wrote:The easy way is to install wamp(5): http://www.en.wampserver.com/
The easy way is not recommended.
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

lol... yeah... I also installed it manually...
christian_phpbeginner: Reinstall PHP and Apache!!! (from the beginning, uninstall everything and install again)
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

Oren wrote:Did you copy the needed files into your system directory? (for Win XP that would be 'system32' and for Win 98 that would be 'system')
Yes, indeed...the php5ts.dll...into system32. Anyway, did I mention that I am using Win XP ? Lol....
ok wrote:The easy way is to install wamp(5): http://www.en.wampserver.com/
Hmm...yes, but I am not a lazy newbie, I want to install it manually, but got stuck in this situation....I'll try your suggestion later when no other solutions available.
ok wrote:lol... yeah... I also installed it manually...
christian_phpbeginner: Reinstall PHP and Apache!!! (from the beginning, uninstall everything and install again)
Ouch...blame me ! I don't know how to uninstall PHP, I think that everyone was too busy writing the newbies on how to install PHP because the installation could sometimes be stressing enough. And even if they wrote the uninstallation, they forgot to give the link in the manual, somehow ! LOL....

Should I delete the php5ts.dll I copied into system32 by myself (manually), and other things...just delete it or there are some procedures ??? Should I delete this one first, then that one, etc...?

Thanks a lot for the responses so far........

Please help...I want to understand php better, I don't know if I install it manually would also bring me closer to PHP or not, actually.....I am kinda stressed out.

Chris
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

Forgot something, I am sure that the APACHE HTTP SERVER has been installed properly, since the "It WORKS !" page was displayed when I typed localhost/index.html....but when I combine it with PHP code...the problem arises.
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

d11wtq wrote:
ok wrote:Run this and see what are the results:

Code: Select all

<?php phpinfo(); ?>
P.S
Use and
I don't think that's going to work if PHP isn't working ;)

I'd check the paths you've given in php.ini for the locations of the php dll file and make sure the exist. Is it possible you've editted the wrong httpd.conf ?
Maybe I did miss or make mistake with the httpd.conf or maybe in the php.ini, but I am stuck...I don't know which which I have missed or where I made the mistakes....

I have opened, read again, and all were just as written in the manual...that's why I am joining this forum....I need help.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

It's not a php.ini problem so you can eliminate that one ;) PHP will actually work without the ini at all.

PHP isn't being called when the request comes in. You can post you httpd.conf file if you like (or if you'd prefer not to expose it to the public you can PM it to me).

Installing PHP/Apache manually is definitely worth doing but if it's taking too long I would definitely just save yourself the hassle and install WAMP/XAMPP :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Did you add this:

Code: Select all

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
to the end of the httpd.conf file?

P.S I assumed you run Apache 2, put the php directory on C and named it 'php'.
Post Reply