<? and <?php directive

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay Binns

    #1

    <? and <?php directive

    I don't have <?php in the beginning of my scripts I just have <?. Now
    the scripts wont run after I upgraded to php 5.1.6. How can I work
    around the fact that all my scripts have <? in the beginning rather than
    <?php ?

    Thanks
  • Benjamin

    #2
    Re: &lt;? and &lt;?php directive

    We advise that you use <?php instead of <? because <? can be confused
    with <?xml version="1.0"?> . However, if you turn short_open_tags to on
    in your php.ini file you can use short tags
    Jay Binns wrote:
    I don't have <?php in the beginning of my scripts I just have <?. Now
    the scripts wont run after I upgraded to php 5.1.6. How can I work
    around the fact that all my scripts have <? in the beginning rather than
    <?php ?
    >
    Thanks

    Comment

    • Chris Hope

      #3
      Re: &lt;? and &lt;?php directive

      Jay Binns wrote:
      I don't have <?php in the beginning of my scripts I just have <?. Now
      the scripts wont run after I upgraded to php 5.1.6. How can I work
      around the fact that all my scripts have <? in the beginning rather
      than <?php ?
      You have three options as I see it:

      1) switch short_open_tags on in your php.ini file

      2) as above but in an .htaccess file (if using Apache)

      3) change all instances of <? to <?php

      --
      Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com

      Comment

      Working...