PHP error, TGP script

Discussion in 'PHP' started by joliett89, Jun 14, 2012.

  1. #1
    I just installed a Thumbnail Picture Gallery program, and I get the following error after I try to use one of the functions (Build Page command):

    Invalid server response

    Parse error: syntax error, unexpected $end in /home/my_user_name/public_html/tgp/tgpx/includes/common.php(559) : eval()'d code on line 1
    {"status":"Success","message":"The selected TGP page has been built"}

    File was uploaded in binary mode (as required), permissions are set correctly, and there is a server-test.php file, which passes the test 100%. I checked for opening and closing tags, and nothing is missing, and I am not sure what would be the next steps in trying to figure out how to fix the issue.

    I have some knowledge of PHP, and I can edit the code, but the file is 3000 lines long, and it is an advanced program with a lot of functions, variables etc, so it doesnt look like something easy to do etc.

    If possible please let me know what is the best way to get around this one, and how to solve other potential errors in the program.

    Thank you.

    # # # Edit # # #

    I checked common.php and all included .php files for number of opening and closing curly braces, and they all match (so it doesnt look like there is something missing).

    # # # Edit 2 # # #

    This is the code:

    https://viewer.zoho.com/docs/zfMdG
     
    Last edited: Jun 14, 2012
    joliett89, Jun 14, 2012 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #2
    #1 text files should be uploaded as ASCII and NOT Binary.

    #2 The code can be 150,000,000 lines long.. it doesn't matter. The debugger tells you the problem and line number that the problem is on.
     
    NetStar, Jun 14, 2012 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    With an eval(), the debugger may be way off on the line number. Regardless, it sounds as if there's a missing bracket or paren.

    function x() {
    if(...) {
    }

    will throw that error. The parser falls off the page looking for the last }. That's what "unexpected $end" means - "I fell off the end of the page looking for a syntax construct that I was told was coming up." Saying { says that the matching } will follow. (Same for ().)
     
    Rukbat, Jun 15, 2012 IP