Preheat the Oven:
Preheat your oven to 350°F (175°C). Grease and flour your cake pans, or line them with parchment paper.
Prepare the Cake Batter:
In a medium bowl, whisk together flour, baking powder, baking soda, and salt. Set aside.
In a large bowl, cream together the softened butter and granulated sugar until light and fluffy.
Beat in the eggs one at a time, making sure each is fully incorporated before adding the next.
Stir in the vanilla extract.
Gradually add the dry ingredients to the wet ingredients, alternating with the sour cream and milk. Mix until just combined.
Fold in the shredded coconut and chopped pecans or walnuts.
Bake the Cake:
Pour the batter evenly into the prepared cake pans or 9x13 inch pan.
Bake for 25-30 minutes (for round pans) or 35-40 minutes (for a 9x13 inch pan), or until a toothpick inserted into the center comes out clean.
Allow the cakes to cool in the pans for 10 minutes before transferring to a wire rack to cool completely.
Prepare the Cream Cheese Frosting:
In a large bowl, beat together the softened cream cheese and butter until smooth and creamy.
Gradually add the powdered sugar, beating until fully combined.
Stir in the vanilla extract.
If the frosting is too thick, add milk a little at a time until the desired consistency is reached.
Frost the Cake:
Once the cake is completely cool, spread a layer of cream cheese frosting on top of one cake layer (if using two layers), then place the second layer on top.
Frost the top and sides of the cake with the remaining cream cheese frosting.