Indeed, acid and base strength varies within different solvents. But, the term pH is applied on aqueous solution or aqueous solvent mixtures, only. However and in terms of reaction mechanism, direct amidation is a dehydration reaction and therefore, aqueous medium and buffers must be avoided. Besides and in absence of catalyst, direct amidation occurs via the preliminary formation of the amine carboxylate salt, followed by thermal dehydration.
Switching DMF by DMSO, mainly depends on the reactants solubility and must be verified in practice. Remember that you don’t have a simple carboxylic acid but a phosphinebenzoic one.
Please, take a look to the attached .PDF-file that might be helpful.