When Display_errors is off in php.ini it is hard to see where the bug is!
While you are working in server where display errors are off you can add this code on top of the page and it will show whats going on in your php code.
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
I prefer to use this code through a function or include file and when you are done you can close or disable.