I often use CakePHP when Rails isn't possible. To debug errors I usually find the error.log
in the tmp folder and tail it in the terminal with the command...
tail -f app/tmp/logs/error.log
It give's you running dialog from cake of what is going on, which is pretty handy, if you want to output something to it mid code you can use.
$this->log('xxxx');
This can usually give you a good idea of what is going on/wrong.