Having been ill in bed for about two months,he had a hard time toclimb the hill
这里的Having been ill in bed for about two months是一个【现在分词短语】,在句中作【原因状语】,相当于一个【原因状语从句】.
Having been ill in bed for about two months,he had a hard time toclimb the hill=Because he had been ill in bed for about two months,he had a hard time toclimb the hill.