Cannot "Hello World" with PHP
Posted by: curlybit89 (---.hsd1.ga.comcast.net)
Date: July 03, 2009 05:42AM

Hello everyone,

I am trying to get PHP to print out a simple "Hello World" message but failing over and over.

Here is the code I am using:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[www.w3.org];
<html xmlns="[www.w3.org];
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>

<body>
<?php echo("Hello World"winking smiley; ?>
</body>
</html>

I am not running skype and have changed the default port to 8080, I am currently running Windows Vista Basic with the firewall off. Apache v2.2.11 PHP v5.2.9-2.

Any suggestions are appreciated.

Options: ReplyQuote
Re: Cannot "Hello World" with PHP
Posted by: showstopper (---.tstt.net.tt)
Date: July 03, 2009 07:17AM

this is what it should be

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[www.w3.org];>
<html xmlns="[www.w3.org];>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>

<body>
<?php echo("Hello World"winking smiley ?>
</body>
</html>

Fitcom - Technology and SEO with a side of awesome

Installing and Configuring a WAMP Server in Windows 7 & 8

Options: ReplyQuote
Re: Cannot "Hello World" with PHP
Posted by: xmanhattan (---.kln.forthnet.gr)
Date: July 03, 2009 07:58AM

Make sure that your file name is: what-ever-you-name-it.php
Not an .htm or .html ending.

Options: ReplyQuote
Re: Cannot "Hello World" with PHP
Posted by: yfastud (Moderator)
Date: July 03, 2009 08:21AM

actually, make sure there is no hidden .txt extension and run your php file through localhost; check here for more detail
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Cannot "Hello World" with PHP
Posted by: freedom (202.65.168.---)
Date: July 09, 2009 08:48AM

>?php
echo "Hello World1";
?>

Options: ReplyQuote
Re: Cannot "Hello World" with PHP
Posted by: imaaxa (---.knology.net)
Date: July 23, 2009 07:40AM

first open a browser and type in localhost, if you do not get a page php or apache is not running.

<?php
echo "Hello World1";
?>

save file hello_world.php in you localhost root folder, then type in localhost/hello_world.php

Options: ReplyQuote


Sorry, only registered users may post in this forum.