Stress energy tensor and scalar field The lagrangian for a scalar field $\phi$ is $$\mathcal{L}=\frac12 \partial_{\mu}\phi \partial^{\mu} \phi -V(\phi)$$
From Noither's theoreme we got stress energy tensor as $$T^{\mu \nu}=\partial^\mu \phi \partial^\nu \phi -g^{\mu \nu}\mathcal{L}$$
If we consider the FRW metric for flat homogenous space-time $$g_{\mu\nu}= \left(
\begin{array}{cccc}
-1 & 0 & 0 & 0\\
0 & a^2(t) & 0 & 0\\
0 & 0 & a^2(t) & 0\\
0 & 0 & 0 & a^2(t)
\end{array} \right)$$
Since the stress-energy tensor for perfect fluid is $T^{\mu \nu}=diag(\rho ,p ,p ,p)$
So $T^{00} = \rho$ and $T^{ii}=p$
We should get
$$\rho=\frac12 \dot \phi^2 + V(\phi)$$ and $$p=\frac12 \dot \phi^2 - V(\phi)$$
But , I am getting $$\rho=\frac12 \dot \phi^2 - V(\phi)$$ and $$p=\frac12 \dot \phi^2 +V(\phi)$$
My calculation is $$\mathcal{L}=\frac12 g^{\alpha \mu} \partial_{\alpha}\phi \partial_{\mu} \phi -V(\phi)$$ So,$$T^{\mu \nu}=\partial^\mu \phi \partial^\nu \phi -g^{\mu \nu}(\frac12 g^{\alpha \beta} \partial_{\alpha}\phi \partial_{\beta} \phi -V(\phi))$$
and $$T^{00}=\rho=\partial^0 \phi \partial^0 \phi -g^{00}(\frac12 g^{00} \partial_0 \phi \partial_0 \phi -V(\phi))=\dot \phi^2 -(-1)\left(\frac12 (-1)\dot \phi^2 -V(\phi)\right)$$
So, $$\rho=\frac12 \dot \phi^2 - V(\phi)$$ and $$T^{11}=p=\partial^1 \phi \partial^1 \phi -g^{11}(\frac12 g^{00} \partial_0 \phi \partial_0 \phi -V(\phi))=-\frac{1}{a^2(t)}\left(\frac12 (-1)\dot \phi^2 -V(\phi)\right)$$
So,$$p=\frac{1}{a^2(t)}\left(\frac12 \dot \phi^2 +V(\phi)\right)$$
Please tell  me where have I gone wrong.
 A: This is another case of AHHH we have different sign conventions!
It's a shame. We like to read each others' stuff but cannot agree on what is a more natural - $(- + + \dots)$ or $(+--\dots)$.
I mean... the former does leave purely spatial displacements positive, and we're used to that. But the latter leaves timelike displacements positive, so you won't have a bunch of minus signs floating around.
Misner, Wheeler, and Thorne even include a sign supplement in Gravitation.
The problem here is that you're using the metric with one sign convention, and the scalar Lagrangian with the opposite sign convention. For the $(-  ++\dots)$ convention the scalar Lagrangian reads:
$\mathcal L = -\frac{1}{2}g_{\mu\nu}\partial^\mu\varphi\partial^\nu\varphi-V(\varphi)=\frac{1}{2}\dot{\varphi}^2-\frac{1}{2a^2}|\nabla\varphi|^2-V(\varphi)$
In a homogeneous spacetime the gradient term vanishes, $\nabla\varphi=0$.
The (contravariant) Hilbert stress-energy tensor is
$T^{\mu\nu}=-2\frac{\delta\mathcal L}{\delta g_{\mu\nu}}+g^{\mu\nu}\mathcal L=\partial^\mu\varphi\partial^\nu\varphi-g^{\mu\nu}\left(\frac{1}{2}g^{\alpha\beta}\partial_\alpha\varphi\partial_\beta\varphi+V(\varphi)\right)$.
We can read off the energy density for the homogeneous case
$\rho = T^{00}=\dot\varphi^2-(-1)\left(-\frac{1}{2}\dot{\varphi}^2+V(\varphi)\right)=\frac{1}{2}\dot{\varphi}^2+V(\varphi)$
We should be a little more careful with the pressure. Recall from continuum mechanics that the pressure is the average of the diagonal components of the stress tensor i.e. $1/d$ of the trace over spatial indices,
$P = \frac{1}{d}g_{ij}T^{ij} =  0-\left(-\frac{1}{2}\dot{\varphi}^2+V(\varphi)\right)=\frac{1}{2}\dot{\varphi}²-V(\varphi)$
So we see everything is quite Kosher. Had you, on the other hand, used the $(+--\dots)$ sign convention, then the Lagrangian you chose would be correct. As a rule of thumb, I try to pay attention to whether papers are written by particle physicists or cosmologists. The former tend to prefer the first sign convention, while the latter the second.
Hope that helps!
