A primitive rootmodulo p is a generator of the cyclic multiplicative group(Z/pZ)×, so it has order p−1. If g is one generator, the generators are exactly gk with gcd(k,p−1)=1. Hence there are ϕ(p−1). For p=2 the group is trivial and its unique element is its generator, consistently with ϕ(1)=1.