From template.php to tpl.php I define variables in template.php file preprocess_page but it come undefined in tpl.php files. What can be a problem? Here is code

template.php file

$user_profile = profile2_load_by_user($uid, 'user_profile');
$vars['user_profile'] = $user_profile;


tpl.php file

print_r($user_profile);
Firstly, check to see that profile2_load_by_user is a function available via a .module file and not something you will need to load via module_load_include() - which will load other files, such as .inc files.

Second, check the argument list for the preprocess hook. Did you define it as &amp;$variables and mistakenly assign it to $vars which would mean nothing in this context? Did you forget to pass by reference via &amp; which makes the array  modifiable?

Third, if you just added this code, clear your site caches so the changes are picked up.

Fourth, the function name isn't preprocess_page. It should be 
 MYTHEME_preprocess_page.