2016-03-27, 00:50:22
(2016-03-26, 22:29:21)johnstray2001 Wrote: What are the 2 different environments you are using? A 500 error refers to "Internal Server Error" which on some systems can be triggered by a PHP warning/error.
Hi, thanks for the quick reply and pointing in the right direction! I temporarily replaced my php.ini by the packaged php-development.ini. Here's the error that is now shown:
Quote:Parse error: syntax error, unexpected '(string)' (string) (T_STRING_CAST) in /var/www/blog/plugins/gs-blog/inc/frontEndFunctions.php on line 327
On my local development/testing server I have php 5.6.17 (distro based on debian jessie), whereas on my public server it's 5.4.45.
The problem seems to be a parser improvement in the newer php version. Here's the change I had to apply to gs-blog/inc/frontEndFunctions.php to make it compatible again:
Code:
*** gs-blog/inc/frontEndFunctions.php 2016-03-26 15:54:30.000000000 +0100
--- ../gs-blog/inc/frontEndFunctions.php 2016-03-26 15:43:12.000000000 +0100
***************
*** 324,332 ****
if($excerpt) { // If we are showing the excerpt...
$excerpt_string = $Blog->create_excerpt(html_entity_decode($data->content), 0, $excerpt_length); // Create the excerpt
if($thumbnail) { // If we are showing a thumbnail with it...
- if(!empty((string)$data->thumbnail)) { // Does a thumbnail exist with the post?
- // Output the HTML for the image
$thumbfile = (string) $data->thumbnail;
$excerpt_string = '<img src="'.$SITEURL.'data/uploads/'.$thumbfile.'" class="blog_recent_posts_thumbnail" />'.$excerpt_string;
}
}
--- 324,332 ----
if($excerpt) { // If we are showing the excerpt...
$excerpt_string = $Blog->create_excerpt(html_entity_decode($data->content), 0, $excerpt_length); // Create the excerpt
if($thumbnail) { // If we are showing a thumbnail with it...
$thumbfile = (string) $data->thumbnail;
+ if(!empty($thumbfile)) { // Does a thumbnail exist with the post?
+ // Output the HTML for the image
$excerpt_string = '<img src="'.$SITEURL.'data/uploads/'.$thumbfile.'" class="blog_recent_posts_thumbnail" />'.$excerpt_string;
}
}