PHP 5.2 on fresh HD installation

tom on April 13th, 2007

I was installing PHP 5.2 with GD support on a brand spanking new HD.

With a ./configure like:

./configure –enable-fastcgi –enable-discard-path –enable-force-redirect –with-gd –with-jpeg-dir=/usr/local/lib –with-png-dir=/usr/local/lib

You will definitely need some dependencies. Here is how I solved them on CentOS 4.4:

# yum install libjpeg-devel

#yum install libxml2-devel

#yum install flex

#yum install libpng-devel

#yum install libstdc++-devel.i386 (for 32 bit machines)

As you can see, you will need the development packages to install PHP

I was getting some errors though:

checking whether the C++ compiler (gcc ) works… no

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

I already had gcc installed so I wasn’t sure what the problem was. I checked the config.log, and found this:


gcc: installation problem, cannot exec `cc1plus’: No such file or directory

Which meant there was no frontend C Compiler, despite having gcc installed.

I searched around, and finally figured out the solution was to install gcc-c++ (the frontend compiler.

I did this by simply typing

#yum install gcc-c++

And that worked!

Hope this helps anyone. If anyone has any other problems while installing PHP 5.2.X on a brand new HD, register and post some comments and I’ll see what I can do.

P.S. Since I was installing this for Lighttpd 1.5 as a fastcgi zend extension, make sure you have FastCGI installed. You can do it by typing:

cpan install FCGI


Leave a Reply