Results 1 to 6 of 6

Thread: "Hello World" error

  1. #1
    Join Date
    Aug 2002
    Posts
    6,209
    Rep Power
    0

    Default "Hello World" error

    I'm trying to start learning PHP, but the first tutorial, "Hello World" is already giving errors.

    Code:
    <html>
     <head>
     <title>PHP Test</title>
     </head>
     <body>
     
    <?php echo '<p>Hello World</p>'; ?> 
    
     </body>
    </html>
    Should give me a page with the words "Hello World" only, instead it also gives the characters

    '; ?>
    What am I doing wrong?
    .
    PC - Ubuntu 15.04 64bit Desktop
    HP Pav G60-236US 3GB RAM Laptop, Ubuntu 15.04 64bit and Win7 Home

    "So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"


    Changes to posting in Classifieds

  2. #2
    Join Date
    Jan 2011
    Posts
    938
    Rep Power
    7

    Default

    You example code is correct, so what you're getting is very weird.
    1.8 Ghz Pentium 4 (OC'd.) / Intel P4 (478) Motherboard / 800MHz DDR / 256 Mb DDR RAM / 40GB Seagate / RIVA TNT2 Pro 32MB / 24X12X24 Sony CDRW+ / 18" View Sonic CRT / Windows ME Yes it will play Doom... i plan on trying Crysis 3 one of these days.

  3. #3
    Join Date
    Feb 2003
    Posts
    3,019
    Rep Power
    0

    Default

    Copy and paste the hello world 2 or 3 times and see if you get the output repeats. It could be a problem with your installation or maybe your php is set up to use regular opening tags like "<? ... ?>"

  4. #4
    Join Date
    Oct 2005
    Posts
    742
    Rep Power
    0

    Default

    YOLO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    3.14159265358979323846264338327950288
    4197169399375105820974944592307816406
    28620899862803482534211706798 pi 101

  5. #5
    Join Date
    Aug 2002
    Posts
    6,209
    Rep Power
    0

    Default

    I think the problem might be in some weird configuration of my Ubuntu computer. When I tested it on my website it worked perfectly.

    I think in future I'll stop testing on my personal PC.
    .
    PC - Ubuntu 15.04 64bit Desktop
    HP Pav G60-236US 3GB RAM Laptop, Ubuntu 15.04 64bit and Win7 Home

    "So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"


    Changes to posting in Classifieds

  6. #6
    Join Date
    Feb 2003
    Posts
    3,019
    Rep Power
    0

    Default

    Personal pcs are the best to test on. - no Internet required. If you can find the php.ini files you can then compare the one you have on your server with the one on your pc. Or just reinstall.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •