This is a never ending problem.
I have several pages running into the Internal server Error 500.
Ex. at
http://www.n3xt-gaming.com - When I activate:
$autoresize=1;
if($autoresize==1) {
preg_match_all("|(\[img\])(.*)(\[\/img\])|i", $content, $imgtags, PREG_SET_ORDER);
foreach($imgtags as $teil) {
$content = str_replace('[IMG]', '[img]', $content);
$content = str_replace('[/IMG]', '[/img]', $content);
$picinfo = getimagesize($teil[2]);
switch($picinfo[2]) {
case 1: $format = "gif"; break;
case 2: $format = "jpeg"; break;
}
if(!$picsize_l) $size_l = "9999"; else $size_l=$picsize_l;
if(!$picsize_h) $size_h = "9999"; else $size_h=$picsize_h;
if($picinfo[0] > $size_l OR $picinfo[1] > $size_h) $content = str_replace('[img]'.$teil[2].'[/img]', '[url='.$teil[2].']<img src="'.$teil[2].'" b$
elseif($picinfo[0] > (2*$size_l) OR $picinfo[1] > (2*$size_h)) $content = str_replace('[img]'.$teil[2].'[/img]', '[url='.$teil[2].'][b]Large pict$
else {
$content = str_replace('[img]'.$teil[2].'[/img]', '<img src="'.$teil[2].'" border="0">', $content);
}
}
}
else $content = preg_replace("#\[img\](.*?)\[/img\]#si", "<img src=\"\\1\" border=\"0\">", $content);
return $content;
}
The page is not able to load and causes the internal server error 500.
When I set $autoresize=1; to $autoresize=0; the page works fine - The function is very important to that community, since else their users will be able to post very large images which causes the page to look weird.
Apache error:
[Fri Jan 02 17:13:15 2009] [notice] mod_fcgid: call /var/www/virtual/n3xt-gaming.com/htdocs/index.php with wrapper /var/www/fcgi/n3xt-gaming.com/php5-fcgi-starter
[Fri Jan 02 17:13:40 2009] [notice] mod_fcgid: call /var/www/virtual/n3xt-gaming.com/htdocs/index.php with wrapper /var/www/fcgi/n3xt-gaming.com/php5-fcgi-starter
[Fri Jan 02 17:14:01 2009] [notice] mod_fcgid: process /var/www/virtual/n3xt-gaming.com/htdocs/index.php(3527) exit(communication error), terminated by calling exit(), return code: 0
[Fri Jan 02 17:14:43 2009] [notice] mod_fcgid: process /var/www/virtual/n3xt-gaming.com/htdocs/index.php(3536) exit(communication error), terminated by calling exit(), return code: 0
[Fri Jan 02 17:15:04 2009] [notice] mod_fcgid: call /var/www/virtual/n3xt-gaming.com/htdocs/index.php with wrapper /var/www/fcgi/n3xt-gaming.com/php5-fcgi-starter
[Fri Jan 02 17:15:54 2009] [notice] mod_fcgid: process /var/www/virtual/n3xt-gaming.com/htdocs/index.php(3551) exit(communication error), terminated by calling exit(), return code: 0
[Fri Jan 02 17:21:16 2009] [notice] mod_fcgid: call /var/www/virtual/n3xt-gaming.com/htdocs/index.php with wrapper /var/www/fcgi/n3xt-gaming.com/php5-fcgi-starter
[Fri Jan 02 17:24:40 2009] [notice] mod_fcgid: call /var/www/virtual/n3xt-gaming.com/htdocs/index.php with wrapper /var/www/fcgi/n3xt-gaming.com/php5-fcgi-starter
[Fri Jan 02 17:25:43 2009] [notice] mod_fcgid: process /var/www/virtual/n3xt-gaming.com/htdocs/index.php(3745) exit(communication error), terminated by calling exit(), return code: 0
[Fri Jan 02 17:25:45 2009] [notice] mod_fcgid: call /var/www/virtual/n3xt-gaming.com/htdocs/index.php with wrapper /var/www/fcgi/n3xt-gaming.com/php5-fcgi-starter
Same as at my own blog running wordpress, the page only loads after you retry a few times.