Reusing header.php from Yii application

In your header.php you are probably using wp_title(). This one requires at least two global variables: $wpdb (the get_query_var() call) and $wp_locale, on singular views a global $post object too.

So you have to create these variables, or set wp_title() in a conditional, like this:

if ( ! empty ( $GLOBALS['wpdb'] ) )
    wp_title();