While commands proposed by @olivia will work, they can get really slow. Keep in mind that when using find with -exec the chmod command will be executed for each found entry separately. It can be done much faster though:

find /opt/lampp/htdocs -type d -print0 | xargs -0 chmod 755 
find /opt/lampp/htdocs -type f -print0 | xargs -0 chmod 644
0