Can solid acids and bases have pH values? If not, how are they classified as acids or bases?
I think we should not mix the concept of pH, which is purely an analytical measurement, with the concept of acid and bases. It is a common misconception that pH does not exist in organic solvents.  As you already know, there are several views of an acid or bases. The current IUPAC version is "A molecular entity or chemical species capable of donating a hydron (proton) (see Brønsted acid) or capable of forming a covalent bond with an electron pair (see Lewis acid)." This definition does not require the presence of water or any pH value.

If we take pure dry HCl gas and ammonia gas and mix them. The reaction is a classic acid base reaction. Solid ammonium chloride is formed instantly. One may then ask a question of what is the pH of a gas? However gas phase acid base chemistry does exist and it can be studied by mass spectrometry but pH does not need to be invoked.

Now instead of asking the pH of solid acids/bases, a more realistic question is what is the surface pH of a given solid? I was interested in this type of problems sometime ago but didn't find much literature. Assume an ion-exchanger which consists of $\ce{SO3-H+}$ groups on a solid polymeric matrix, basically sulfonate styrene divinylbenzene. Assume that it is in equilibrium with 1 mM HCl solution. The solution pH is 3, but what is the surface pH? It is certainly way below zero, because sulfonic acid is a very strong acid and the surface concentration of sulfonic acid groups is pretty high yet the groups are not mobile in the solution!

Similarly, solid acid catalysts exist. Also see how solid acids are titrated [1].

References


Chai, S.-H.; Wang, H.-P.; Liang, Y.; Xu, B.-Q. Sustainable Production of Acrolein: Investigation of Solid Acid–Base Catalysts for Gas-Phase Dehydration of Glycerol. Green Chem. 2007, 9 (10), 1130–1136. https://doi.org/10.1039/B702200J.