You search whole file in magento folder and change following.
folder permission 0777 to 0755 and 0750 t0 0755
file 0640 t0 0644
You search whole file in magento folder and change following.
folder permission 0777 to 0755 and 0750 t0 0755
file 0640 t0 0644