php5 configure pbm

Hello,

I try to recreate a rpm after having change the spec file. As it didn’t work I’ve tried to rectreate the RPM from the original SPEC file.

I have some pbms with libjpeg, libpng or zlib .so and .a files which are not find by the configure. In fact my box is a x86_64 bits and it looks like the configure looks in the /usr/lib dir rather than /usr/lib64 lib.

I could install all need .so and .a files in the /usr/lib dir by installing the i386 version of the rpm but for example it is not possible for libpng-devel.

So my question is why this :/configure looks not in /usr/lib64 but in /usr/lib/

Here is the ./configure in the SPEC file

%configure
–cache-file=…/config.cache
–with-libdir=%{_libdir}
–with-config-file-path=%{_sysconfdir}
–with-config-file-scan-dir=%{_sysconfdir}/php.d
–disable-debug
–with-pic
–disable-rpath
–with-bz2
–with-curl
–with-exec-dir=%{_bindir}
–with-freetype-dir=%{_prefix}
–with-png-dir=%{_prefix}
–enable-gd-native-ttf
–without-gdbm
–with-gettext
–with-gmp
–with-iconv
–with-jpeg-dir=%{_prefix}
–with-openssl
–with-png
–with-pspell
–with-expat-dir=%{_prefix}
–with-pcre-regex=%{_prefix}
–with-zlib
–with-layout=GNU
–enable-exif
–enable-ftp
–enable-magic-quotes
–enable-sockets
–enable-sysvsem --enable-sysvshm --enable-sysvmsg
–enable-track-vars
–enable-trans-sid
–enable-yp
–enable-wddx
–with-pear=/usr/share/pear
–with-kerberos
–enable-ucd-snmp-hack
–with-unixODBC=shared,%{_prefix}
–enable-memory-limit
–enable-shmop
–enable-calendar
–enable-dbx
etc…

and here is what the rpmbuild -ba php.spec returns about the ./configure

  • ./configure --host=x86_64-redhat-linux-gnu --build=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/usr/etc --datadir=/usr/share --includedir=/usr/include –libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/usr/var --sharedstatedir=/usr/com --mandir=/usr/man --infodir=/usr/info --cache-file=…/config.cache --with-libdir=/usr/lib --with-config-file-path=/usr/etc --with-config-file-scan-dir=/usr/etc/php.d --disable-debug --with-pic --disable-rpath --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-png --with-pspell --with-expat-dir=/usr --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-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/usr/etc/httpd/conf/magic --without-sqlite --with-libxml-dir=/usr --with-xml --enable-force-cgi-redirect --enable-pcntl --with-imap=shared --with-imap-ssl --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-ncurses=shared --with-gd=shared --enable-bcmath=shared --enable-dba=shared --with-db4=/usr --with-xmlrpc=shared --with-ldap=shared --with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config --enable-dom=shared --with-dom-xslt=/usr --with-dom-exslt=/usr --with-pgsql=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-fastcgi

As you can see the --libdir returns /usr/lib and not /usr/lib64 but in the spec file there is the %{_libdir}. This last one should returns the good libdir normally as configure has detected that the os was a x86_64

I not sure to inderstand why. Any idea ?

I don’t want create symlinks between /usr/lib and /usr/lib64 for libpng, libjpeg and zilb etc…

Well maybe it is a bug in the spec file. For information it is the default SRPM from centos for php5.0.4 (from contrib or centosplus)

All ideas or experience with this kind of pbms are welcome (the libjpeg, libpng one and the usr/lib rather usr/lib64). Indeed I have all libjpeg, libjpeg-devel, libpng, gd, gd-devel installed but in /usr/lib64

Thanks for your help

Pascal

I also tried with the php5.1.1 of interworx-cp

I didn’t change anything to the php5.spec of interworx, and here again I can’t recreate the rpm from the spec file

Here is the error

  • echo ‘Patch #0 (php-5.0.5-configure.patch):’
    Patch #0 (php-5.0.5-configure.patch):
  • patch -p0 -s
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    124 out of 286 hunks FAILED – saving rejects to file configure.rej
    error: Bad exit status from /var/tmp/rpm-tmp.14307 (%prep)

The patch is not applied.

Iworx team do you know why ?

Pascal

Well the patch try to patch a file which doesn’t exist.

So I tried to first install the the php-5.0.5-iworx as the patch php-5.0.5-configure.patch patch a file for the configure of this php version.

Now, without changing anything in the php5.spec file the command rpmbuild -ba php5.spec works fine.

So the questions for iworx team is :

  • I update the php-5.0.5 spec file to be what I need (all php5 files in specific dirs like usr/bin/php5/ to allow to have both php4 and php5 on the same box)
  • Install the new generated rpm
  • But after this how to update php-5.1.1-iworx to have the patch work OK ?

Thanks

Pascal

arff I spoke to quick.

The patch is applied well but I have a pbm during the build process at

/bin/sh /usr/src/redhat/BUILD/php-5.0.5/build-cgi/libtool
…/…

I have this error returned

/usr/bin/ld: cannot find -l/usr/lib64/libgdbm.so
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.31788 (%build)

I don’t understand why. I have gd-devel installed and the file /usr/lib64/libgdbm.so exists

]# ls -l /usr/lib64/libgdbm.so
lrwxrwxrwx 1 root root 16 Jun 14 15:22 /usr/lib64/libgdbm.so -> libgdbm.so.2.0.0

here is all libgdm files

ls -l /usr/lib64/libgdbm*

-rw-r–r-- 1 root root 75212 Feb 18 2005 /usr/lib64/libgdbm.a
-rwxr-xr-x 1 root root 786 Feb 18 2005 /usr/lib64/libgdbm.la
lrwxrwxrwx 1 root root 16 Jun 14 15:22 /usr/lib64/libgdbm.so -> libgdbm.so.2.0.0
lrwxrwxrwx 1 root root 16 Jun 14 15:21 /usr/lib64/libgdbm.so.2 -> libgdbm.so.2.0.0
-rwxr-xr-x 1 root root 27104 Feb 18 2005 /usr/lib64/libgdbm.so.2.0.0

Do you already have this kind of pbms ?

I really don^t know what to do now… Helps are really welcome

Pascal

all dependencies of ligdbm.so seems to be ok :

ldd -v /usr/lib64/libgdbm.so

    libc.so.6 => /lib64/tls/libc.so.6 (0x00000032e8c00000)
    /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)

    Version information:
    /usr/lib64/libgdbm.so:
            libc.so.6 (GLIBC_2.2.5) => /lib64/tls/libc.so.6
    /lib64/tls/libc.so.6:
            ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
            ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
            ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2

It seems there is a bug in the libtool process when creating the PHP bin in /sapi/cgi/.

Indeed it does

/bin/sh /usr/src/redhat/BUILD/php-5.0.5/build-cgi/libtool --silent --preserve-dup-deps --mode=link gcc -export-dynamic -O2 -g -fomit-frame-pointer -fPIC -L/usr/kerberos/lib -L/usr/kerberos/lib64 -L/usr/lib64

…/… (= ALL etx/.lo files )

then at the end
-l -lgdbm -lexslt -lgmp -lfreetype -l -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -lidn -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lz -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -o sapi/cgi/php

I find this -l -lgdbm very strange. Indeed on -l is alone without any argument.

Do you have gdbm and gdbm-devel installed? If not, I would try installing those two packages. They are not the same as gd-devel. gd-devel, as you probably know, is an image library, whereas gdbm is a database library.

Socheat

well in php-5.0.4-iworx srpm I’ve seen that there is not exit point on an ./configure error.

In fact exactly as php-5.1.1-iworx or others I still have errors in the ./configure with libjpeg and linpng

checking for the location of libjpeg… /usr/lib64
checking for the location of libpng… /usr/lib64
checking for the location of libXpm… /usr/lib64
checking for FreeType 1.x support… no
checking for FreeType 2… /usr
checking for T1lib support… no
checking whether to enable truetype string function in GD… yes
checking whether to enable JIS-mapped Japanese font support in GD… no
checking for fabsf… no
checking for floorf… no
configure: error: libjpeg.(a|so) not found.
checking for jpeg_read_header in -ljpeg… no
configure: error: Problem with libjpeg.(a|so). Please check config.log for more information.
checking for png_write_image in -lpng… no
configure: error: Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.

but I have these files

]# ll /usr/lib64/libjpeg*
-rw-r–r-- 1 root root 214990 Feb 18 2005 /usr/lib64/libjpeg.a
-rwxr-xr-x 1 root root 472 Feb 18 2005 /usr/lib64/libjpeg.la
lrwxrwxrwx 1 root root 17 Sep 29 13:52 /usr/lib64/libjpeg.so -> libjpeg.so.62.0.0
lrwxrwxrwx 1 root root 17 Jun 14 15:21 /usr/lib64/libjpeg.so.62 -> libjpeg.so.62.0.0
-rwxr-xr-x 1 root root 137448 Feb 18 2005 /usr/lib64/libjpeg.so.62.0.0

ll /usr/lib64/libpng*

-rw-r–r-- 1 root root 237900 Feb 13 2006 /usr/lib64/libpng12.a
lrwxrwxrwx 1 root root 13 Sep 29 14:30 /usr/lib64/libpng12.so -> libpng12.so.0
lrwxrwxrwx 1 root root 19 Sep 29 14:28 /usr/lib64/libpng12.so.0 -> libpng12.so.0.1.2.7
-rwxr-xr-x 1 root root 163432 Feb 13 2006 /usr/lib64/libpng12.so.0.1.2.7
lrwxrwxrwx 1 root root 10 Sep 29 14:30 /usr/lib64/libpng.a -> libpng12.a
lrwxrwxrwx 1 root root 11 Sep 29 14:30 /usr/lib64/libpng.so -> libpng.so.3
lrwxrwxrwx 1 root root 17 Sep 29 14:28 /usr/lib64/libpng.so.3 -> libpng.so.3.1.2.7
lrwxrwxrwx 1 root root 19 Sep 29 14:28 /usr/lib64/libpng.so.3.1.2.7 -> libpng12.so.0.1.2.7

Maybe the libtool error come from this ./configure error as all is related to GD, gdbm, etc…

pfff…

2 days and 2 night trying to rebuild a php5 srpm :\

I really do not understand. PHP5 won’t be on my box soon :wink:

Maybe some of you have already had this kind of pbms, if not, then… php5 will go to @#/!!!

[QUOTE=IWorx-Socheat;10058]Do you have gdbm and gdbm-devel installed? If not, I would try installing those two packages. They are not the same as gd-devel. gd-devel, as you probably know, is an image library, whereas gdbm is a database library.

Socheat[/QUOTE]

yum list gdbm*

Setting up repositories
Reading repository metadata in from local files
Installed Packages
gdbm.x86_64 1.8.0-24 installed
gdbm.i386 1.8.0-24 installed
gdbm-devel.x86_64 1.8.0-24 installed

gdbm is installed.

It’s really too strange !

I just want to change your srpm php5 files to have php5 installed as cli, cgi not as sapi module for apache and binaries located in /usr/bin/php5/ conf files in /etc/php5 and /etc/php5/php.d/ etc… Like this this install won’t broke my existing php4 install.

I also tried to install it manually directly fron tje /BUILD tree by doing a manual configure and a nabual make in the /BUILD/build-cgi/ but I alwayshavce this pbm

In fact the libtool crash to the first arg after -l
If I remove in the spec file in the ./configure the --with-gdbm the error become

usr/bin/ld: cannot find -lcurl

And here is the last lines of libtool. As you can see there is a -l ALONE ???!!!???

-lexslt -lgmp -lfreetype -l -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -lidn -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lz -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -o sapi/cgi/php

Thanks Socheat for your input…
Pascal

Pascal,

I haven’t had those problems in particular but have found that often PHP needs patches to get around low level errors on some platforms. I know the following woroks on Centos 4.x so you may want to use this SRPM as a base. It may not build seamlessly but it shouldn’t totally explode ;).

http://updates.interworx.com/iworx/SRPMS/experimental/php-5.1.2-100.iworx.src.rpm

Chris

I just want to change your srpm php5 files to have php5 installed as cli, cgi not as sapi module for apache and binaries located in /usr/bin/php5/ conf files in /etc/php5 and /etc/php5/php.d/ etc… Like this this install won’t broke my existing php4 install.

I’d build as-is first Pascal, then do the cli/cgi changes first and rebuild and see if it works, then finally add in the conf changes.

Staging it may help deduce what the problem is exactly.

Chris

[QUOTE=IWorx-Chris;10062]I’d build as-is first Pascal, then do the cli/cgi changes first and rebuild and see if it works, then finally add in the conf changes.

Staging it may help deduce what the problem is exactly.

Chris[/QUOTE]

Chris it is of course what I do :slight_smile: you absolutly right, and as I said in a first post I try to do a rpmbuild -ba php5.spec file without any change in the spec file.

When I’ll be able to recreate the rpm then I’ll made my changes :wink:

Thanks for the advise

Pascal

Chris it is of course what I do :slight_smile: you absolutly right, and as I said in a first post I try to do a rpmbuild -ba php5.spec file without any change in the spec file.

Sorry Pascal, I should know better. I’m going through posts over the last few weeks and am apparently skimming too much :(.

So at what stage are you now in the process?

Chris

[QUOTE=IWorx-Chris;10061]Pascal,

I haven’t had those problems in particular but have found that often PHP needs patches to get around low level errors on some platforms. I know the following woroks on Centos 4.x so you may want to use this SRPM as a base. It may not build seamlessly but it shouldn’t totally explode ;).

http://updates.interworx.com/iworx/SRPMS/experimental/php-5.1.2-100.iworx.src.rpm

Chris[/QUOTE]

So Hope you right, I become to be crazy wizth this :wink:

I had tried with your 5.1.1 srpm but it fails at the begining when it try to apply the patch php-5.0.5-configure : see here http://www.interworx.com/forums/showpost.php?p=10048&postcount=2

I promise I give you a big gift for christmas if this last srpms resolve all my pbms (which seems to be always the same kind of)

Thanks

Pascal

Can you open a ticket Pascal. I just now saw that this is a x86_64 box as well and I’d like to take a quick peek at the issue.

Chris

[QUOTE=IWorx-Chris;10078]Can you open a ticket Pascal. I just now saw that this is a x86_64 box as well and I’d like to take a quick peek at the issue.

Chris[/QUOTE]

ok,

Just to let you know that with the php-5.1.2 I have the same pbm than the 5.1.1 with patch of configure (which apparently resolve some x86 missing steps)

Patch #0 (php-5.0.5-configure.patch):

  • patch -p0 -s
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    misordered hunks! output would be garbled
    129 out of 286 hunks FAILED – saving rejects to file configure.rej
    error: Bad exit status from /var/tmp/rpm-tmp.81610 (%prep)

I’m going to open a ticket support now

Thanks as usual

Pascal

Got it built Pascal, check your e-mail and post back here if it works or not when you get a sec.

Chris

Thanks Chris.

For the records
–libdir=lib64 \

resolve a lot of pbms.

I change the spec file to have the php5 installed as CGI and CLI with a current PHP4 version install and if it is ok, I’ll let the srpm and rpm here

Pascal

For those who want have a PHP5 CGI and CLI install with an existing PHP4 modules INSTALL follow this links.
http://www.interworx.com/forums/showthread.php?t=1630

I have modified the exiting iworx SRPM to allow an installation of PHP5 cli and Cgi on a box with an already installed php4 (modules for apache, cgi)

Hope it will help some of you

Pascal
http://carat-hosting.com