Parse error: syntax error, unexpected $end in FILE on line X

Discussion in 'PHP' started by globalcashsite, May 17, 2009.

  1. #1
    Guys

    I just made small changed to my php code and after these changes I am getting this error. Before small changes code was working fine.

    I tried to find where I have open tags, braces, etc but find nothing.

    How I can find exact which line has problem as this error lead to the end of file.

    Any editor or debugger that can lead to the exact line.?

    Right now I am using CuteFTP to edit my files at PC and then upload at my site. I also used 1st page to find exact line where there is error but fail.

    Help me please

    GCS
     
    globalcashsite, May 17, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Doesnt it report the link error rite now ?

    Try dreamweaver
     
    Bohra, May 17, 2009 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    what editor are you using??... follow the error message, there by default states the line of error..
     
    bartolay13, May 17, 2009 IP
  4. octalsystems

    octalsystems Well-Known Member

    Messages:
    352
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    135
    Digital Goods:
    1
    #4
    Hi,

    If error message is like "unexpected $end " it is surely becoz of some unbalanced curly braces .
    check your if ,while and loops to balance them it will defiantly solve ur problem
     
    octalsystems, May 17, 2009 IP
  5. globalcashsite

    globalcashsite Peon

    Messages:
    806
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You people did not read my post very well. I already told I checked code but did not find any thing. Looking if there is any debugger or editor that can point out exact line where is error?

    GCS
     
    globalcashsite, May 17, 2009 IP
  6. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #6
    thats because your not giving the error message.

    "I just made small changed to my php code and after these changes I am getting this error. Before small changes code was working fine."

    then what is the error? (error message)
     
    bartolay13, May 17, 2009 IP
  7. globalcashsite

    globalcashsite Peon

    Messages:
    806
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Title of this thread :D

    Parse error: syntax error, unexpected $end in FILE on line 273

    GCS
     
    globalcashsite, May 17, 2009 IP
  8. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #8
    this is caused by unclosed lines or unclosed conditions.. check the lines in range of line 273, and all the conditions that pass line 273
     
    bartolay13, May 18, 2009 IP
  9. octalsystems

    octalsystems Well-Known Member

    Messages:
    352
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    135
    Digital Goods:
    1
    #9
    u will not find exact line no of error if the error is becoz of missing curly braces "Parse error: syntax error, unexpected $end"
     
    octalsystems, May 18, 2009 IP
  10. globalcashsite

    globalcashsite Peon

    Messages:
    806
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    What I did to solve this issue is restored file from backup and made all changes carefully and it worked. :)

    GCS
     
    globalcashsite, May 18, 2009 IP
  11. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #11
    post your code its probably a ; at the end of one of your variables is missing.
    OR, you have a

    if($somethin){
    (a function inside a function? ..missing bracket, missing ; ???
    } (missing )

    you say you checked your code. But that error is because youre missing a piece of code. period. Check it again.
     
    ezprint2008, May 19, 2009 IP