Can't see php text in browser
Posted by: Goe (---.rochd2.qld.optusnet.com.au)
Date: May 02, 2006 01:01PM

How do I see php coded text in my browser? I'm trying to follow this tutorial (I have WAMP5 installed);
What do they mean 'place it on a PHP enabled server.."? I thought having WAMP5 running did that...
.......................................
PHP and HTML Code:
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>

Display:
Hello World!
If you save this file and place it on PHP enabled server and load it up in your web browser, then you should see "Hello World!" displayed. If not, please check that you followed our example correctly.
..........................................



Post Edited (05-02-06 13:02)

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: May 03, 2006 08:02PM

this same question gets asked at least once a day, do a simple search.

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: Goe (---.rochd2.qld.optusnet.com.au)
Date: May 03, 2006 09:45PM

Gee. Sorry for wasting your precious time.

1) I have searched
2) I did not find
3) I asked the question.

I hope you are proud of your self-righteous condescension.


Options: ReplyQuote
Re: Can't see php text in browser
Posted by: Goe (---.rochd2.qld.optusnet.com.au)
Date: May 03, 2006 10:02PM

... and another thing, Mr. CyberSpatium, if you are referring to the '<?php' issue, you clearly didn't read the code in my post, did you?


Options: ReplyQuote
Re: Can't see php text in browser
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: May 06, 2006 01:59PM

No Mr. Wreckage, I was not talking about the asp short style tags issue. You asked "How do I see php coded text in my browser" and "what do they mean 'place it on a PHP enabled server"

The reason I told you to do a simple search is because you would have found the following answers to your questions (of which I have posted many many many times on this forum).

1.> make sure all your files are in your c:\wamp\www folder. all php, html, images, etc.
2.> make sure when you are accessing your webpage with your browser you use http://localhost. if you try to access the file in your browser as file:///C:/wamp/www/index.php your php code will not get parsed by apache, and will not display.



Post Edited (05-06-06 14:15)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: administrator (199.243.180.---)
Date: May 10, 2006 06:31PM

Cyberspatium is right

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: Wreckage (---.rochd2.qld.optusnet.com.au)
Date: May 19, 2006 09:57AM

Yes, he was with his helpful second reply. I can understand that some of you 'experts' must get a tad frustrated with newbies, but of course you fall into the trap of assuming that *nobody* who asks questions takes the time, or is smart enough, to perform a search.

This is not always the case, however, and answering a question with a rude demand to "...do a simple search." comes across as being neither helpful, nor tolerant. A couple of extra words such as "may I suggest you search using these keywords.....", or "This message should answer your question..." would certainly do a lot to engender confidence and friendliness in this forum.

Cheers.

...and by the way, there is a problem with your forum - my name on the orignal post now reads 'Goe' instead of 'wreckage'.

Cheers.



Post Edited (05-19-06 10:03)

Wherever you go, there you are.

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: imhere2009 (---.server.ntli.net)
Date: May 21, 2006 05:34PM

Hi

Ok guys i have to bring this back up myself. yes i am a newbie but still i have the same problem, this is what is happening, im following a tutorial infact its the same one this guys is doing:

<HTML>
<TITLE>THIS IS MY FIRST PAGE</TITLE>
<BODY>
<?
echo "Hello World";
?>
<BR>
This is just HTML
</BODY>

Should display the following:
Hello World
This is just HTML

Which on my working server it does this correctly, though when trying it locally running wamp ( latest version ) it only out puts the following:

This is just HTML

why is this? anyone know a fix? and before i forget i did try it will the following url:
[localhost]

Which should work, though doesnts, i have even tried a re-install of wamp, though still doesnt work,

Any help?

Thanks
Steve

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: imhere2009 (---.server.ntli.net)
Date: May 21, 2006 05:34PM

Hi

Ok guys i have to bring this back up myself. yes i am a newbie but still i have the same problem, this is what is happening, im following a tutorial infact its the same one this guys is doing:

<HTML>
<TITLE>THIS IS MY FIRST PAGE</TITLE>
<BODY>
<?
echo "Hello World";
?>
<BR>
This is just HTML
</BODY>

Should display the following:
Hello World
This is just HTML

Which on my working server it does this correctly, though when trying it locally running wamp ( latest version ) it only out puts the following:

This is just HTML

why is this? anyone know a fix? and before i forget i did try it will the following url:
[localhost]

Which should work, though doesnts, i have even tried a re-install of wamp, though still doesnt work,

Any help?

Thanks
Steve


Options: ReplyQuote
Re: Can't see php text in browser
Posted by: TwistedChaos (---.rochester.res.rr.com)
Date: May 22, 2006 12:12AM

try changing ypur tag from a <? to a <?php

<? is short tag and is normally disabled in wamp



A Massive Heart Attack = Computer Crash sad smiley

I am a member of CAF -&gt; Computer Addicts Forever smiling smiley

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: ZooDog (---.ntta.org)
Date: May 22, 2006 10:53PM

I am having the same issue. I downloaded and installed WAMP5 over the weekend and am still checking it out (WinXP home). I looked at all the config files but didn't find anything out of the ordinary. I have not modified any of the config files.

The issue is that a "test.html" file with embedded php (using the <?php ... ?> tags) does not execute the php code. Files like "test.php" work as expected, so I know the PHP engine is running an linked to Apache. My test code looks just like Steve's code above.

Any suggestions?

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: ZooDog (---.hsd1.tx.comcast.net)
Date: May 24, 2006 07:00AM

I found the answer to my problem in another forum. Edit "httpd.conf" and search for "addtype". Look for the following line (line 756 in my config file):

AddType application/x-httpd-php .php

Change it to

AddType application/x-httpd-php .php .htm .html

and save the file. Restart Apache service and all should be well.

Good luck.


Options: ReplyQuote
Re: Can't see php text in browser
Posted by: famoussoftguru (---.dsl.irvnca.sbcglobal.net)
Date: May 24, 2006 09:37AM

Wamp only enable a .php extension to load, so check what extension you saved your file or go into your httpd.conf file and add those ur file extension to it. Restart apache and you should be fine

Options: ReplyQuote
Re: Can't see php text in browser
Posted by: yfastud (72.236.169.---)
Date: May 26, 2006 06:13PM

Come on, guys. Don't be so hard on CyberSpatium, he have to go through all the post to answer all questions. Put yourself in his position, what you should do, of course, the answer is as short as possible, right?
Smile and get a smile back.

Options: ReplyQuote


Sorry, only registered users may post in this forum.