Page 1 of 2

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

Posted: Sat Jun 03, 2006 2:54 pm
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

Posted: Sat Jun 03, 2006 4:43 pm
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?

Posted: Sun Jun 04, 2006 4:54 am
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

Posted: Sun Jun 04, 2006 5:24 am
by ok
Run this and see what are the results:

Code: Select all

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

Code: Select all

 and [code]

Posted: Sun Jun 04, 2006 6:22 am
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 ?

Posted: Sun Jun 04, 2006 6:24 am
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 ?

Posted: Sun Jun 04, 2006 6:48 am
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')

Posted: Sun Jun 04, 2006 6:55 am
by ok
The easy way is to install wamp(5): http://www.en.wampserver.com/

Posted: Sun Jun 04, 2006 7:57 am
by Oren
ok wrote:The easy way is to install wamp(5): http://www.en.wampserver.com/
The easy way is not recommended.

Posted: Sun Jun 04, 2006 8:04 am
by ok
lol... yeah... I also installed it manually...
christian_phpbeginner: Reinstall PHP and Apache!!! (from the beginning, uninstall everything and install again)

Posted: Sun Jun 04, 2006 1:41 pm
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

Posted: Sun Jun 04, 2006 1:44 pm
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.

Posted: Sun Jun 04, 2006 1:51 pm
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.

Posted: Sun Jun 04, 2006 2:24 pm
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 :)

Posted: Sun Jun 04, 2006 3:37 pm
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'.