PHP Compile Error on CentOS Install

I installed CentOS 5 on my VMWare a few days ago. I installed gcc via yum, compiled and installed libxml2. I then tried to install PHP 5.2.3 and received this error:

configure: error: installation or configuration problem: C++ compiler cannot create executables.

It took me forever to figure this out, but I had to install the g++ library, then it compiled fine.

yum install gcc-c++