Electronic energy levels of porphyrins are influenced by the local chemical environment