Let $p$ be a prime and $n>1$ an integer such that $n\mid p-1$ and $p\mid n^3-1$, then $4p-3$ is a perfect square.

Note that $$n\,|\,p-1\implies p-1=kn\implies p=kn+1$$ for some $k\in \mathbb N$

Similarly $$p\,|\,n^2+n+1\implies mp = n^2+n+1$$ for some $m\in \mathbb N$

It follows that $$n^2+n+1=m(kn+1)=mkn+m\implies n^2+(1-mk)n+(1-m)=0$$

Now, the roots of this quadratic must be integers, so the discriminant must be a perfect square. It follows that there is some $N\in \mathbb N$ such that $$(1-mk)^2+4(1-m)=N^2$$

Case I: $m=1$ In that case $$p=n^2+n+1\implies 4p-3=(2n+1)^2$$

Case II: $m>1$. In that case we easily see that $$4(m-1)≥2(mk-1)+1$$ But this quickly shows that $k=1$ which implies that $p=n+1$ which would imply that $n+1\,|\,n^2+n+1$ which is impossible.