Amazing problem to run any php script

Discussion in 'PHP' started by Litonice09, Jan 17, 2011.

  1. #1
    Today i saw a new problem in my computer that if i start any script with <? and ?> tag then the script doesn't show any result in browser but if i put <?php and ?> then it shows in my browser output. Another thing that the first thing works in any computer of my friends. How it possible? I've the latest configuration in my computer.
     
    Litonice09, Jan 17, 2011 IP
  2. swashata

    swashata Member

    Messages:
    86
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Check the PHP configuration. Shorttags are not activated by default. Simply edit your php.ini file and set the value of short_open_tag to 1
     
    swashata, Jan 17, 2011 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    please note; that short tags are not to GOOD way to code your scripts, most hosters doesn't support <? and ?> tags ;) Keep that in mind!
     
    EricBruggema, Jan 18, 2011 IP
  4. Litonice09

    Litonice09 Well-Known Member

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    Digital Goods:
    1
    #4
    Where i'll find the file? I cann't access in the hosting files. Please clear about it.
     
    Litonice09, Jan 21, 2011 IP
  5. Litonice09

    Litonice09 Well-Known Member

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    Digital Goods:
    1
    #5
    In my local pc server doesn't support like this kind of <? and ?> tags. Few days later i recognize it,that here is something wrong. Finally i got it.
     
    Litonice09, Jan 21, 2011 IP
  6. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #6
    if you're on winwdows, you have to tell us which name has your webserver.
    If you're on Linux, so it's in /etc/php5
     
    G3n3s!s, Jan 22, 2011 IP
  7. breham

    breham Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    the file you're looking for is php.ini

    The line you need to edit is 'short_opentag=On' or 'Off'

    On a linux box you can find the file using 'locate php.ini' - on windows do a search

    Hope this helps
    Brett
     
    breham, Jan 25, 2011 IP