My question is if I can like a fan page with some graph api or something else?
here is my code:
$facebook->api('[fanpage_id]/likes', 'post',
array('access_token' => 'my_token'));
and if I can do it by javascript SDK without the likebox?
also I gave the publish_stream permission.
No, this is not possible. Likes can only be registered and submitted via the like button.