Take a moment to plan out what you want to give your adviser as a token of gratitude. It's important to consider what would constitute a thoughtful yet appropriate, ethical gift; giving an adviser something pricey, while a nice gesture, could end up causing you problems as it might come off looking a bit like a bribe. Instead, keep your personal spending low, setting the maximum value of the gift at around $10 to $20 as a general rule of thumb.
Assuming your adviser is in the same field, consider giving a gift that incorporates your area of study into its theme. Depending on your adviser's personality, the gift could be humorous or serious; this is something to consider before making a purchase. An example of a funny, generally inexpensive gift could be a coffee mug with a silly slogan that pokes fun at your field of study. For a more serious gift, you could give a subscription to a corresponding academic journal, or you could give a personalized piece of equipment that relates to your field.
If you know your adviser well enough, you might consider giving a personal gift that pays tribute to his personal favorites. Keep these personal items relatively professional, but demonstrate that you appreciate your adviser's interests; think about favorite foods, pastimes or local haunts. For instance, if she has a favorite coffee shop near campus, give a gift certificate of an appropriate value to that specific venue. Or, if you know he's a chocoholic, bake him up a batch of goodies like brownies or cookies to bring for him to munch on in his office.
If you're stumped on what to give your adviser, just express yourself on paper to tell him exactly how he's helped you along toward achieving your goals. Nothing can take the place of an honest expression of gratitude, and it's likely your adviser will appreciate this moving gesture. Purchase a card or some stationery to write out your note or create your own at home for a bit of a personal touch. Deliver the card in person if you can; otherwise, send it in the mail around the time you receive your Ph.D.