We'll be in Italy during July (not ideal, but you go when you can....). I've heard mixed things about length of pants when visiting churches (outside of religious services). Is it all about covering the knee (permitting longer shorts) or is it expected that regardless of the heat that full length slacks are expected?
We are here now and was 90 degrees and quite hot in the sun. I strongly suggest long shorts just at knee is fine and if you need to pull right below,knee that would be best. But woman need to cover arms with scarves. They turned people away at Vatican with short shorts and tank or sleeveless tops.
Knees and shoulders must be covered, male and female.
Maybe a pair of pants that zips off to shorts would work for you. Wear them as shorts to keep cool, then zip on the legs when needed.
I have seen people turned away with shorts just at the knee. When they say cover the knees, they mean cover the knees. But a lot of smaller churches don't have guards in front. But it is also a matter of respect. These are functioning religious sites, not museum pieces so be respectful. I always wear light weight pants and don't find them any hotter than standard walking shorts.
We couldn't figure it,out some people had shorts at knee or above knee and got in. Only short shorts were turned away. It was 93 when we went and my husband wore jeans to,be safe but then all these men had shorts right at knee and got in. We were confused but didn't want to take any chances of,being turned away.
You can get inexpensive lightweight washable linen slacks for men at Old Navy. Very comfortable. Don't wear denim in the heat.
I don't know how far the fashion-adventurist in you is willing to go but, in Europe, men wear capri-length pants that would solve your problem! If you wait and buy a pair once you get there you won't need to worry about covering your knees or being too terribly hot.
As long as your shorts cover the knee, you would be okay. If they question it, wear a long enough top so that you can pull your unbuttoned shorts down just a little more.
My husband has those zipper pants Andrea referenced and they are pretty great. He bought his from The North Face. The material is pretty light and they are pretty stylish as well.
My husband got his zip-off pants at REI.