Do not use die to debug

From Joomla! Documentation

Joomla! 1.5 includes the ability to optionally store the user session in the database. In PHP 5, because of the order in which it does things, a connection to the database will be closed before it fires the session handlers.

As a result of this, the common-place practice of using the die( 'test1' ); function will result in a plethora of errors being thrown, similar to the following: