compiling php 5.2 on CentOS 5.4

I need to have more options turned on than what the 5.4 distribution comes with like phpDOM XML mySQL GD to mention a few so…

My current build looks like this (if you don’t know what your current build looks like google phpinf.cgi)

‘./configure’ ‘–host=x86_64-redhat-linux-gnu’ ‘–build=x86_64-redhat-linux-gnu’ ‘–target=x86_64-redhat-linux’ ‘–program-prefix=’ ‘–prefix=/usr’ ‘–exec-prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–datadir=/usr/share ‘ ‘–includedir=/usr/include’ ‘–libdir=/usr/lib64′ ‘–libexecdir=/usr/libexec’ ‘–localstatedir=/var’ ‘–sharedstatedir=/usr/com’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–cache-file=../config.cache’ ‘–with-libdir=lib64′ ‘–with-config-file-path=/etc’ ‘–with-config-file-scan-dir=/etc/php.d’ ‘–disable-debug’ ‘–with-pic’ ‘–disable-rpath’ ‘–without-pear’ ‘–with-bz2′ ‘–with-curl’ ‘–with-exec-dir=/usr/bin’ ‘–with-freetype-dir=/usr’ ‘–with-png-dir=/usr’ ‘–enable-gd-native-ttf’ ‘–without-gdbm’ ‘–with-gettext’ ‘–with-gmp’ ‘–with-iconv’ ‘–with-jpeg-dir=/usr’ ‘–with-openssl’ ‘–with-pcre-regex=/usr’ ‘–with-zlib’ ‘–with-layout=GNU’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-magic-quotes’ ‘–enable-sockets’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-sysvmsg’ ‘–enable-wddx’ ‘–with-kerberos’ ‘–enable-ucd-snmp-hack’ ‘–enable-shmop’ ‘–enable-calendar’ ‘–without-mime-magic’ ‘–without-sqlite’ ‘–with-libxml-dir=/usr’ ‘–enable-xml’ ‘–with-system-tzdata’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–without-mysql’ ‘–without-gd’ ‘–disable-dom’ ‘–disable-dba’ ‘–without-unixODBC’ ‘–disable-pdo’ ‘–disable-xmlreader’ ‘–disable-xmlwriter’ ‘–disable-json’ ‘–without-pspell’

Notice ‘–disable-dom’  ’–disable-xmlreader’ ‘–disable-xmlwriter’ I need these 3 enabled

also I want GD so I am taking ‘–without-gd’ out

So we know the drill download the rpm dermp it

cd in the php.xxx directory

and try

#./configure it is gonna come up with errors so the fun starts

OK here we go

First we need the httpd-devel packege

#yum -y install httpd-devel-2.2.3-22.el5.1vm.x86_64 (or whatever version your apache is)

and make sure Perl is up2date

It seems that ./configure went a litle further this time but it is missing

xml2-config
configure: error: xml2-config not found. Please check your libxml2 installation.

here we need to install the libxml2-devel

#yum install up2date libxml2-devel

now it complains about

checking for PCRE support… yes
configure: error: Could not find pcre.h in /usr

ok let’s go look for PCRE

#yum install pcre-devel

now what??

checking for BZip2 support… yes
checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution

took out –with-bz2

missing libcurl

#yum install curl-devel

let see now…  OK that did that now we are missing

checking for GNU MP support… yes
configure: error: Unable to locate gmp.h

#yum install gmp-devel

OK that worked

now what maybe Make??? need to do some searching

It is making keep your fingers crossed for no errors

make returned

Build complete.
Don’t forget to run ‘make test’.

make test

BE CAREFUL DON’T make install

We need to rebuild the rpm and istall from the there

So now we build the rmp back

# rpmbuild -bb /usr/src/redhat/SPECS/php.spec

it comlains that there is no rpmbuild so we need to get it

#yum install rpm-build

so now we try again

# rpmbuild -bb /usr/src/redhat/SPECS/php.spec

error: Failed build dependencies:
bzip2-devel is needed by php-5.2.11-jason.1.x86_64
pam-devel is needed by php-5.2.11-jason.1.x86_64
libstdc++-devel is needed by php-5.2.11-jason.1.x86_64
sqlite-devel >= 3.0.0 is needed by php-5.2.11-jason.1.x86_64
readline-devel is needed by php-5.2.11-jason.1.x86_64
libtool >= 1.4.3 is needed by php-5.2.11-jason.1.x86_64
gcc-c++ is needed by php-5.2.11-jason.1.x86_64
libc-client-devel is needed by php-5.2.11-jason.1.x86_64
postgresql-devel is needed by php-5.2.11-jason.1.x86_64
unixODBC-devel is needed by php-5.2.11-jason.1.x86_64
net-snmp-devel is needed by php-5.2.11-jason.1.x86_64
libxslt-devel >= 1.0.18-1 is needed by php-5.2.11-jason.1.x86_64
ncurses-devel is needed by php-5.2.11-jason.1.x86_64
libjpeg-devel is needed by php-5.2.11-jason.1.x86_64
libpng-devel is needed by php-5.2.11-jason.1.x86_64
freetype-devel is needed by php-5.2.11-jason.1.x86_64
libmcrypt-devel is needed by php-5.2.11-jason.1.x86_64
mhash-devel is needed by php-5.2.11-jason.1.x86_64
libtidy-devel is needed by php-5.2.11-jason.1.x86_64
freetds-devel is needed by php-5.2.11-jason.1.x86_64
aspell-devel >= 0.50.0 is needed by php-5.2.11-jason.1.x86_64

so here we go again

we start

#yum -y install (all of the above)

And now

# rpmbuild -bb /usr/src/redhat/SPECS/php.spec

Seem that is recompiling again and doing the make install and make test

Well that seems was successful (two hours from start) and we still have to install the rmps

But that tomorrow

  1. No comments yet.

  1. March 17th, 2010
    Trackback from : Антон Павлович
  2. April 16th, 2010
    Trackback from : Kylie Batt