The fundamental relation is, if I recall correctly,
##\mathrm dE = T \, \mathrm dS - p \, \mathrm dV + \mu \, \mathrm dN##
So setting dE = 0, you obtain P/T = dS/dV when dN = 0, so if the number of particles and the energy in the system don't change.
For convenience you can put this in the subscript:
##\left( \frac{\partial S}{\partial V} \right)_{E, N} = \frac{P}{T},##
as a reminder that E and N should be kept constant.