MyBB Community Forums

Full Version: Global.php Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am getting an error in the apache error logs and forum home is white paging.

HP Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in <snip>/forums/global.php(527) : eval()'d code on line 58, referer: 

I don't what's wrong.

My forum is located at pvpmc.com/forums. I have been creating a plugin that will display avatars from a remote site.

I have also tried disabling all plugins, but that did not work.
To determine where the problem is, you need to read the error message first.

Quote:HP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in <snip>/forums/global.php(527) : eval()'d code on line 58, referer:

So we have three clues:
  1. The problem is at global.php
  2. The problem is at line #527
  3. The issue in presented inside a eval(); function.
  4. The problem is somehow at line #58 of the code being eval()'d

Now that we know where to search for the problem, open global.php around line #527 this is the original code of MyBB 1.6.8:
525  eval("\$gobutton = \"".$templates->get("gobutton")."\";");
526  eval("\$htmldoctype = \"".$templates->get("htmldoctype", 1, 0)."\";");
527  eval("\$header = \"".$templates->get("header")."\";");
528  
529  $copy_year = my_date("Y", TIME_NOW);

The problematic line is a eval(); function, as mentioned in the message. Now you need to check the content of you "header" template, the problem is there (around line #58).
(2012-07-31, 05:36 PM)Omar G. Wrote: [ -> ]To determine where the problem is, you need to read the error message first.

Quote:HP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in <snip>/forums/global.php(527) : eval()'d code on line 58, referer:

So we have three clues:
  1. The problem is at global.php
  2. The problem is at line #527
  3. The issue in presented inside a eval(); function.
  4. The problem is somehow at line #58 of the code being eval()'d

Now that we know where to search for the problem, open global.php around line #527 this is the original code of MyBB 1.6.8:
525  eval("\$gobutton = \"".$templates->get("gobutton")."\";");
526  eval("\$htmldoctype = \"".$templates->get("htmldoctype", 1, 0)."\";");
527  eval("\$header = \"".$templates->get("header")."\";");
528  
529  $copy_year = my_date("Y", TIME_NOW);

The problematic line is a eval(); function, as mentioned in the message. Now you need to check the content of you "header" template, the problem is there (around line #58).

Thank you for your help, I just found it was a Gzip compression error. It fixed it by changing the compression level.