For some reasons, my site stopped responding today, Error
The www.mysite.com page isn’t working
www.mysite.com is currently unable to handle this request. HTTP ERROR 500
I understand there are many reasons for 500 error and it hard to know what exactly happend, I had a look into server log and notice this error
[Wed May 11 10:31:27 2016] [warn] [client x.y.z] mod_fcgid: stderr: PHP Parse error: syntax error, unexpected 'return' (T_RETURN) in /var/www/vhosts/mysite.com/httpdocs/pro/includes/common.inc on line 5106.
Looking into common.inc
function drupal_json_encode($var) {
// The PHP version cannot change within a request.
static $php530;
if (!isset($php530)) {
$php530 = version_compare(PHP_VERSION, '5.3.0', '>=');
}
if ($php530) {
// Encode <, >, ', &, and " using the json_encode() options parameter.
return json_encode($var, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
}
// json_encode() escapes <, >, ', &, and " using its options parameter, but
// does not support this parameter prior to PHP 5.3.0. Use a helper instead.
include_once DRUPAL_ROOT . '/includes/json-encode.inc';
return drupal_json_encode_helper($var);
}
Line 5106 = return json_encode($var, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);