LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compiling PHP on RHEL 5 64 bit (https://www.linuxquestions.org/questions/linux-software-2/compiling-php-on-rhel-5-64-bit-685606/)

Noodles25 11-23-2008 04:18 PM

Compiling PHP on RHEL 5 64 bit
 
I'm having a hard time trying to configure/compile PHP for 64 bit.

This is the configure options that I'm using:

Code:

./configure --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --datadir=/usr/share --libdir=lib64 --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-regex=system --with-xmlrpc=shared --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-sockets --enable-sysvsem --enable-sysvshm --enable-wddx --with-pear=/usr/share/pear --with-mysql=shared,/usr --with-snmp=shared,/usr --enable-ucd-snmp-hack --enable-bcmath --enable-shmop --enable-calendar --enable-mbstring=shared --enable-mbregex --with-apxs2=/usr/local/apache2/bin/apxs --with-xsl --enable-mbstring --with-pspell
The configure crashes out with:
Code:

checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

In the config.log file it doesn't mention anything about MySQL having problems, but I do get quite a few messages like this:

Code:

/usr/bin/ld: skipping incompatible /usr/lib/libgmp.so when searching for -lgmp
/usr/bin/ld: skipping incompatible /usr/lib/libgmp.a when searching for -lgmp
/usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/libpng.so when searching for -lpng
/usr/bin/ld: skipping incompatible /usr/lib/libpng.a when searching for -lpng
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libjpeg.so when searching for -ljpeg
/usr/bin/ld: skipping incompatible /usr/lib/libdb-4.3.so when searching for -ldb-4.3
/usr/bin/ld: skipping incompatible /usr/lib/libdb-4.3.a when searching for -ldb-4.3
/usr/bin/ld: skipping incompatible /usr/lib/libcurl.so when searching for -lcurl
/usr/bin/ld: skipping incompatible /usr/lib/libcurl.a when searching for -lcurl
/usr/bin/ld: skipping incompatible /usr/lib/libbz2.so when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/lib/libbz2.a when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libxml2.so when searching for -lxml2

I can't understand why it's looking in /usr/lib/ for these libraries when I've specified --libdir=lib64 (also tried --libdir=/usr/lib64).

Can anyone help?
Thanks

Noodles25 11-23-2008 09:11 PM

I finally managed to do it after fiddling with some configure options.

For anyone else who is trying to do the same, I had to add --libdir=/usr/lib64 and --with-libdir=lib64

If you're using aspell like I am then you also need to add /usr/local/lib to /etc/ld.so.conf and run ldconfig before trying to compile php

salter 11-24-2008 06:57 PM

libmysqlclient has been bundled sometimes named as libmysqlclient10 (for whatever reason), but lately it seems to have abandoned entirely. I have wasted a lot of time lately by trying to install libmysqlclient and libmysqlclient10 from precompiled packages also on a 64-bit server - it didn't work out in the end for what I needed it.

Unfortunately compiling entirely from source is no option in my case, but it's good to know what to do, just in case. Thanks for posting the solution!

Linux Archive

Noodles25 11-24-2008 07:02 PM

I think you only get libmysqlclient10 etc if you use the compat RPM's from MySQL which have the older clients bundled.

theamitverma 05-13-2010 05:06 PM

Thanks buddy, it worked like a charm for "./configuration'.

Though, now "make" command is providing the error below (may be related to the same Mysql Library issue) -
ext/mysql/.libs/php_mysql.o(.text+0x1d01): In function `zif_mysql_set_charset':
/root/install.php.5.3.2/php-5.3.2/ext/mysql/php_mysql.c:1219: undefined reference to `mysql_set_character_set'
ext/mysql/.libs/php_mysql.o(.text+0x1f21): In function `php_mysql_do_query_general':
/root/install.php.5.3.2/php-5.3.2/ext/mysql/php_mysql.c:1309: undefined reference to `mysql_set_server_option'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


All times are GMT -5. The time now is 02:14 AM.