removing the @ error suppresion didn't help much, still no output, it just hangs.
added this before the function callsyslog(LOG_DEBUG,serialize($code_image));
syslog(LOG_DEBUG,serialize($font_size));
syslog(LOG_DEBUG,serialize($angle));
syslog(LOG_DEBUG,serialize($font_x));
syslog(LOG_DEBUG,serialize($font_y));
syslog(LOG_DEBUG,serialize($char_color));
syslog(LOG_DEBUG,serialize($fontface));
syslog(LOG_DEBUG,serialize($character['id']));and it gave me this in the logs May 7 09:58:28 batou apache2: i:0;
May 7 09:58:28 batou apache2: i:18;
May 7 09:58:28 batou apache2: i:-11;
May 7 09:58:28 batou apache2: i:102;
May 7 09:58:28 batou apache2: i:31;
May 7 09:58:28 batou apache2: i:228;
May 7 09:58:28 batou apache2: s:72:"/home/fiore/-censored-.com/forum/Themes/default/fonts/Screenge.ttf";
May 7 09:58:28 batou apache2: s:1:"N";
I can't see anything out of the ordinary apart from $code_image not being serializable because it's a resource (dunno if it should return i:0 though).
Workaround:
So what I did was comment out that line, which actually simulated a clean failure. The rest of the script could then resume and fall back and voila, the image verification works.
I still don't understand why it failed.