PHP server config, help please.

Discussion in 'PHP' started by lateuk, Oct 16, 2007.

  1. #1
    Hello,
    Can anyone explain why on some servers <? is ok but on other servers you need to use <?php

    Thanks

    Late
     
    lateuk, Oct 16, 2007 IP
  2. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    probably just based on the version of php installed.

    not sure though, could also be that <?php is alreay opened, and you just need <? to declare again
     
    Lordy, Oct 16, 2007 IP
  3. DKameleon

    DKameleon Member

    Messages:
    29
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    38
    #3
    it depends from option short_open_tag
     
    DKameleon, Oct 16, 2007 IP
  4. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    On top of what DKameleon wrote, it's also an option that is deprecated and to be removed in PHP6 I believe.

    Always use <?php.
     
    TwistMyArm, Oct 16, 2007 IP
  5. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What about <?=
     
    jnestor, Oct 16, 2007 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    nico_swd, Oct 16, 2007 IP
  7. tamen

    tamen Peon

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Please don't use short openening tags. XHTML pages on the server makes an PHP-error if short openening tags are enabled.
     
    tamen, Oct 17, 2007 IP
  8. qualityhostings

    qualityhostings Well-Known Member

    Messages:
    1,764
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #8
    For better coding experience, always use <?php
     
    qualityhostings, Oct 17, 2007 IP