It's really hard to debug code without (a) seeing any code, and (b) knowing what errors you are getting (if any).
Maybe try adding this to the start of your file to get some clues where things are broken?
<?php
ini_set('display_errors', true); // set to false in production
error_reporting(E_ALL);
// rest of code...