Compiling PHP 5.2.3 fails

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
elbekko
Posts: 17
Joined: 2006/07/23 19:58:08
Contact:

Compiling PHP 5.2.3 fails

Post by elbekko » 2007/06/21 19:52:15

Hello,

I'm trying to compile PHP 5.2.3 from source. Configure went fine, but when running make I get the following error:

/usr/bin/ld: cannot find -lintl
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1

Yet the intl package has been installed:

# rpm -qa | grep intl
intltool-0.35.0-2

Does anybody have any idea on how to fix this?

Thanks,
Ben

(I also posted this on the PHP install newsgroup, but didn't get a reply yet, so trying here)

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: Compiling PHP 5.2.3 fails

Post by michaelnel » 2007/06/22 00:13:39

http://www.jasonlitka.com/2007/06/01/upgrading-to-php-523-on-rhel-and-centos/

elbekko
Posts: 17
Joined: 2006/07/23 19:58:08
Contact:

Re: Compiling PHP 5.2.3 fails

Post by elbekko » 2007/06/22 07:53:42

Yes, I saw that. But as I have to add some extra configuration options (sybase-ct) I have to manually compile.

RemiFedora
Posts: 19
Joined: 2007/05/10 17:13:40
Location: Champagne...
Contact:

Re: Compiling PHP 5.2.3 fails

Post by RemiFedora » 2007/06/24 19:05:04

See : http://remi.collet.free.fr/index.php?2007/06/03/366-php-523-1

Most extensions available (including php-mssql and freetds).

Remi.

nahum
Posts: 1
Joined: 2007/07/10 21:35:50

Re: Compiling PHP 5.2.3 fails

Post by nahum » 2007/07/10 21:46:01

I have the same problem with php 5.2.3, I can't use rpms or src rpms beacuse gd on centos 4 and 5 has a nasty bug that crashes my mapserver application.

I have found that the problem is only in x86_64. not in x86 version of centos 4.

Anybody have installed from source on x86_64.

Thanks.

electrik
Posts: 1
Joined: 2007/07/13 12:04:02

Re: Compiling PHP 5.2.3 fails

Post by electrik » 2007/07/13 12:09:53

It's been awhile since I compiled PHP on my x86_64 machine, but I remember having problems with it as well. I _think_ I resolved it by using the --with-libdir=/lib64/ option in my ./configure.

I very well could be wrong though, so don't throw me under the bus if so. :-?

johnmaag
Posts: 6
Joined: 2007/07/16 18:51:42

Re: Compiling PHP 5.2.3 fails

Post by johnmaag » 2007/07/16 21:41:19

[quote]
elbekko wrote:
Yes, I saw that. But as I have to add some extra configuration options (sybase-ct) I have to manually compile.[/quote]

I am having all kinds of trouble with php and oracle. I have oracle local but would take an instantclient install. He for sure has the packages but when I install apache cannot find php. WHen I deinstall and put back 5.1.6 of fof the distro php comes back.

When I have tried making this package myself with rpmbuild, I get this error:

error: Installed (but unpackaged) file(s) found:" /usr/lib/php/modules/oci8.so

and I have no diea how to fix it.

When I try to make it from the php source I get two issues. 1) I cannot get it to install in the default location, I can only get a /usr/locla install and I do not know how to point apache at /usr/local instead of the default location and 2) the "make test" is failing due to different versions of what I have made and what it needs for the test suite. I assume this is due to me installing and removing php packages.

Any help would be appreciated. I have read instructions online until I am blue in the face but just cannot figure it out.

RemiFedora
Posts: 19
Joined: 2007/05/10 17:13:40
Location: Champagne...
Contact:

Re: Compiling PHP 5.2.3 fails

Post by RemiFedora » 2007/07/17 04:20:59

i've wrote some time ago a doc about this (sorry, but in french)

http://remi.collet.free.fr/index.php?2006/02/09/110-acces-aux-bases-de-donnees-oracle-en-php

You need to add oracle libraries to LD_LIBRARY_PATH for apache.

The best solution seems to edit the /etc/sysconfig/httpd to add something like :
[code]export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib
export NLS_LANG=FRENCH_FRANCE.AL32UTF8
export TNS_ADMIN=/etc/oracle[/code]

If you need to rebuild the spec to include oracle, take a look at my specfile (search for all conditionnal part encosed by with_oci8) :
http://remi.collet.free.fr/rpms/SPEC/php-5.2.3-remi.spec

Or try my build (only latest php-5.2.3)


Remi

elbekko
Posts: 17
Joined: 2006/07/23 19:58:08
Contact:

Re: Compiling PHP 5.2.3 fails

Post by elbekko » 2007/07/17 13:04:42

Would a similar solution work for Sybase? I still have not found the solution to my problem.

johnmaag
Posts: 6
Joined: 2007/07/16 18:51:42

Re: Compiling PHP 5.2.3 fails

Post by johnmaag » 2007/07/25 04:11:02

Remi, sorry it has taken me so long to reply.

For some reason my installation of apache (default off of cd for Centos 5) would not see the php off of your packages. when I deinstalled your packages and put back the default installation of 5.1.6 then all was well.

Remi, I will look at your spec and see if I can figure out what went wrong on the rpmbuild.

I finally did get it installed from a compile but had to wipe out the source and start from fresh source. That cleaned up a lot of my problems for some reason even when I did a make clean. For someone else, here is what I did: (Remi, please comment as you see fit)

yum install wget nano make autoconf automake rpm-build postfix fileutils file libtool gcc cpp gcc-c++ perl-DBI readline-devel libc-clien
t-devel libstdc++-devel bzip2-devel curl-devel db4-devel expat-devel gmp-devel aspell-devel httpd-devel libjpeg-devel libpng-devel pam-d
evel openssl-devel sqlite-devel zlib-devel pcre-devel krb5-devel cyrus-sasl-devel openldap-devel postgresql-devel unixODBC-devel libxml2
-devel net-snmp-devel libxslt-devel libxml2-devel expat-devel ncurses-devel gd-devel freetype-devel mysql-devel

unalias rm
rm -r php-5.2.3
tar zxf php-5.2.3.tar.gz
cd ~jmaag/php-5.2.3
./configure \
--cache-file=../config.cache \
--with-libdir=/usr/lib \
--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-png \
--with-pspell \
--with-expat-dir=/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-kerberos \
--enable-ucd-snmp-hack \
--with-unixODBC=shared,/usr \
--enable-memory-limit \
--enable-shmop \
--enable-calendar \
--enable-dbx \
--enable-dio \
--with-mime-magic=/etc/httpd/conf/magic \
--without-sqlite \
--with-libxml-dir=/usr \
--with-xml \
--build=i686-redhat-linux-gnu \
--host=i686-redhat-linux-gnu \
--target=i386-redhat-linux-gnu \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-libdir=/usr/lib \
--with-apxs2=/usr/sbin/apxs \
--with-oci8=shared,/opt/oracle/product/10.2.0 --enable-sigchild
make
make test

When I do the make test I get these errors:

Module compiled with module API=20050922, debug=0, thread-safety=1
PHP compiled with module API=20060613, debug=0, thread-safety=1

I just ignored these and did a make install and all was well after restarting apache

I have this in /etc/sysconfig/httpd:
ORACLE_SID=XE ; export ORACLE_SID
ORACLE_HOME=/opt/oracle/product/10.2.0 ; export ORACLE_HOME
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib; export LD_LIBRARY_PATH
NLS_LANG="AMERICAN_AMERICA.US7ASCII" ; export NLS_LANG


I have this in /etc/php.ini:

extension=oci8.so


I hope this helps anyone after me.

Post Reply

Return to “CentOS 5 - Server Support”