Hint $\ {\rm mod}\ p\!:\ x^2\equiv -1\,\Rightarrow\, x^4\equiv 1\,$ so $\,x\,$ has order $\,4.\,$ Thus $\,x^{p-1}\equiv 1\,\Rightarrow\, 4\mid p-1$
Remark $\ $ The order inference is a very special case of the general result that $\,a\,$ has order $\,n\,$ if $\,a^n = 1\,$ but $\,a^{n/p} \ne 1\,$ for every prime $\,p\mid n.\,$ The proof is easy: if the order $\,k\,$ is proper divisor of $\,n\,$ then $\,k\,$ arises by deleting at least one prime $\,p\,$ from the prime factorization of $\,n,\,$ so $\,k\mid n/p,\,$ say $\, jk = n/p,\,$ so $\,a^{n/p} \equiv (a^k)^j\equiv 1^j\equiv 1,\,$ contra hypothesis.