Link to home
Start Free TrialLog in
Avatar of drozdzowski
drozdzowski

asked on

cannot compile php5.2.3 in Solaris10

Hi,

I am trying to compile php5.2.3 in Solaris 10 and I'm getting the following errors:
ld: fatal: library -lcomn: not found
ld: fatal: library -lct: not found
ld: fatal: library -lcs: not found
ld: fatal: File processing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

I am using the following when calling the configure cmd for php:

./configure --prefix=/opt/php --with-apache=../apache_1.3.37 --without-sqlite --without-mysql ----with-cybercash=../mck-3.2.0.4-solaris-sparc --with-sybase-ct=/exportome/sybase/OCS-15_0 --with-curl --enable-track-vars --with-gd -with-jpeg --with-zlib --disable-pdo --with-openssl=/usr/local/ssl --with-libxml-dir=/usr/local --with-xsl=/usr/local

I have tried all the 5.x versions of php and I still keep getting the same error. Any comments/suggestions will be greatly welcomed.

Thanks.
Lorena.
Avatar of hernst42
hernst42
Flag of Germany image

Does the compile and make work if you skip the options ----with-cybercash=../mck-3.2.0.4-solaris-sparc --with-sybase-ct=/exportome/sybase/OCS-15_0
run a
make distclean
before you run the configure again.

If all works enable each option to see what causes the problem. Then you might need to check the öibrary path
Avatar of drozdzowski
drozdzowski

ASKER

Hi,

I tried your suggestions above but now I am getting this error when running make:

ml2 -lz -liconv -lsocket -lnsl -lm  -o sapi/cli/php
Undefined                       first referenced
 symbol                             in file
__udiv_qrnnd                        /usr/local/lib/libgcrypt.so
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

To compile I used:
./configure --prefix=/opt/php --with-apache=../apache_1.3.37 --without-sqlite --without-mysql --with-curl --enable-track-vars --with-gd -with-jpeg --with-zlib --disable-pdo --with-openssl=/usr/local/ssl --with-libxml-dir=/usr/local --with-xsl=/usr/local

In installed libxml, zlib, libgcrypt and others from the sunfreeware.com site. Any suggestions will be greatly welcomed.

Lorena.
I use a script like this to build php, apche and oracle on solaris 10 fo x86_64 (no SSL support) You might change it to use your options.


#!/bin/bash

BUILDVERSION=1.0.1
HTTPDVERSION=2.2.6
PHPVERSION=5.2.4
LIBPNGVERSION=1.2.12

# prepare destination
PKGNAME=XAP
PREFIX=/opt/${PKGNAME}
rm -rf $PREFIX
mkdir -p $PREFIX

# use system 64-bit zlib, else linking problems might occur

# build expat, needed for apache and php
rm -rf /root/src/expat-2.0.1 && \
cd /root/src && \
tar -xf /root/tars/expat-2.0.1.tar && \
cd /root/src/expat-2.0.1 && \
./configure --prefix=$PREFIX --enable-static && \
make && make install
if [ $? -ne 0 ]; then exit; fi

# build iconv, needed for apache and php
rm -rf /root/src/libiconv-1.11 && \
cd /root/src && \
tar -xf /root/tars/libiconv-1.11.tar && \
cd /root/src/libiconv-1.11 && \
./configure --prefix=$PREFIX --enable-static && \
make && make install
if [ $? -ne 0 ]; then exit; fi

# build apache-webserver
#--with-z=$PREFIX
rm -rf /root/src/httpd-${HTTPDVERSION} && \
cd /root/src && \
tar -xf /root/tars/httpd-${HTTPDVERSION}.tar && \
cd /root/src/httpd-${HTTPDVERSION} && \
./configure --prefix=$PREFIX --enable-static --enable-so --with-expat=$PREFIX --with-iconv=$PREFIX --disable-dav --disable-userdir --disable-autoindex --disable-authn-file --disable-authn-default --disable-include --disable-setenvif --disable-asis --disable-authz-groupfile --disable-authz-user --disable-env && \
make && make install
if [ $? -ne 0 ]; then exit; fi

# build libxml2, needed for php
#--with-zlib=$PREFIX
rm -rf /root/src/libxml2-2.6.30 && \
cd /root/src && \
tar -xf /root/tars/libxml2-2.6.30.tar && \
cd /root/src/libxml2-2.6.30 && \
./configure  --prefix=$PREFIX --with-iconv=$PREFIX  && \
make && make install
if [ $? -ne 0 ]; then exit; fi

# build png, needed for php-gd
rm -rf /root/src/libpng-$LIBPNGVERSION && \
cd /root/src && \
tar -xf /root/tars/libpng-$LIBPNGVERSION.tar && \
cd /root/src/libpng-$LIBPNGVERSION && \
./configure --prefix=$PREFIX --enable-static && \
make && make install
if [ $? -ne 0 ]; then exit; fi

# build jpeg, needed for php-gd
rm -rf /root/src/jpeg-6b && \
cd /root/src && \
tar -xf /root/tars/jpeg-6b.tar && \
cd /root/src/jpeg-6b && \
./configure --prefix=$PREFIX --enable-static && \
make && make install
if [ $? -ne 0 ]; then exit; fi

# build freetype, needed for php-gd
rm -rf /root/src/freetype-2.3.5 && \
cd /root/src && \
tar -xf /root/tars/freetype-2.3.5.tar && \
cd /root/src/freetype-2.3.5 && \
GNUMAKE=/usr/local/bin/make ./configure --prefix=$PREFIX && \
/usr/local/bin/make && /usr/local/bin/make install
if [ $? -ne 0 ]; then exit; fi

# build php http://www.php.net
#--with-zlib-dir=$PREFIX
rm -rf /root/src/php-${PHPVERSION} && \
cd /root/src && \
tar -xf /root/tars/php-${PHPVERSION}.tar && \
cd /root/src/php-${PHPVERSION} && \
./configure --prefix=$PREFIX --with-iconv-dir=$PREFIX --with-libxml-dir=$PREFIX --with-apxs2=$PREFIX/bin/apxs --with-config-file-path=$PREFIX/etc --with-config-file-scan-dir=$PREFIX/etc/php.ini.d --with-libexpat-dir=$PREFIX --with-oci8=shared,/export/home/oracle/oracle/product/10.2.0/db_2/ --enable-fastcgi --with-gd=shared --with-freetype-dir=$PREFIX --with-png-dir=$PREFIX --with-jpeg-dir=$PREFIX --enable-gd-native-ttf --with-ttf=$PREFIX --enable-pcntl=shared --enable-posix=shared --enable-pdo=shared --with-pdo-oci=shared,/export/home/oracle/oracle/product/10.2.0/db_2 --with-pdo-sqlite=shared --with-sqlite=shared --with-zlib=shared --enable-dom=shared --with-iconv=shared --enable-xmlreader=shared  --enable-xmlwriter=shared --enable-tokenizer=shared --enable-soap=shared --enable-ctype=shared --enable-hash=shared --enable-json=shared --enable-ftp=shared --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --enable-sockets=shared && \
make && make install && make install-modules
if [ $? -ne 0 ]; then exit; fi

# build APC http://pecl.php.net/package/APC
# http://pecl.php.net/get/APC-3.0.14.tgz
rm -rf /root/src/APC-3.0.14 && \
cd /root/src && \
tar -xf /root/tars/APC-3.0.14.tar && \
cd /root/src/APC-3.0.14 && \
$PREFIX/bin/phpize && \
./configure --enable-apc --with-php-config=$PREFIX/bin/php-config --enable-apc-sem --with-apxs=$PREFIX/bin/apxs && \
make && make install

# configure php-settings
mkdir -p $PREFIX/etc/php.ini.d
cp /root/php.ini $PREFIX/etc/

#activate apc in php
echo "extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1 " >> $PREFIX/etc/php.ini.d/apc.ini

# activate oracle and gd for php
echo "extension=oci8.so" >> $PREFIX/etc/php.ini.d/oci8.ini
echo "extension=gd.so" >> $PREFIX/etc/php.ini.d/gd.ini

# update apache config for php
echo "AddType application/x-httpd-php .php .phtml" >> $PREFIX/conf/httpd.conf
echo "DirectoryIndex index.php" >> $PREFIX/conf/httpd.conf
perl -pi -e "s#$PREFIX/htdocs#/srv/www/htdocs#" $PREFIX/conf/httpd.conf
perl -pi -e "s#AllowOverride None#AllowOverride All#" $PREFIX/conf/httpd.conf

Avatar of Tintin
Given that php 5.2.3 is available on sunfreeware.com, is there any reason you want to compile it yourself?
We usually compile php tailored for our needs. I tried compiling php5.2.0 as well but still I'm getting the same error and even with the latest version php5.2.4 I get errors. So sunfreeware is the easiest solution but not the one I would like to take.

Lorena.
Thanks to hernst42 suggestions and after troubleshooting gcc, I was able to compile and install php5.2.3 with the following commands:

./configure --prefix=/opt/php --with-apache=../apache_1.3.37 --without-sqlite --
without-mysql --with-curl --enable-track-vars --with-gd -with-jpeg --with-zlib -
-disable-pdo --with-openssl=/usr/local/ssl --with-libxml-dir=/usr/local --with-x
sl=/usr/local --with-cybercash=../mck-3.2.0.4-solaris-sparc

However when I try to compile php with sybase i.e. --with-sybase-ct=/export/home/sybase/OCS-15_0

I get the following errors:
cket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl -lxslt -lxml2 -lz -liconv -lsocket -lnsl -lm  -o sapi/cli/php
ld: fatal: library -lcomn: not found
ld: fatal: library -lct: not found
ld: fatal: library -lcs: not found
ld: fatal: File processing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


Any suggestions in how to resolve the above issue will be greatly appreciated.

Thanks.

Lorena.
Try the the configure with

LDFLAGS="-L /export/home/sybase/OCS-15_0/lib" ./configure .....

in the directory /export/home/sybase/OCS-15_0/lib you should be able to find files like libcomn* libtct*, ...

make sure you did a make distclean berfore running the new configure command.
Hi,

hernst42, I tried to compile php5.2.3 with the LDFLAGS suggestion to no luck. I still keep getting the same error. In addition, I set the #define CTLIB_VERSION CS_VERSION_150 in the ../php-5.2.3/ext/sybase_ct/php_sybase_ct.h to no luck either.

Any other ideas.

Thanks.

Lorena.
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

I was finally able to sort of compile php5.2.3 with sybase15.0. There is a script within the within ../sybase/OCS-15_0/scripts/lnsyblibs directory that sort of 're-creates' the links for the old sybase libraries. Take a look at the README within that directory.

Though all still is not good since after the make comes the make install, and here is where the php install fails i.e.:

bash-3.00# make install
Installing PHP SAPI module:       apache
Installing PHP CLI binary:        /opt/php/bin/
Installing PHP CLI man page:      /opt/php/man/man1/
Installing build environment:     /opt/php/lib/php/build/
Installing header files:          /opt/php/include/php/
Installing helper programs:       /opt/php/bin/
  program: phpize
  program: php-config
Installing man pages:             /opt/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /opt/php/lib/php/
ld.so.1: php: fatal: libsybunic.so: open failed: No such file or directory
ld.so.1: php: fatal: relocation error: file /export/home/sybase/OCS-15_0/lib/libsybcomn.so: symbol uniconv_HandleGet: referenced symbol not found
Killed
make[1]: *** [install-pear-installer] Error 137
make: *** [install-pear] Error 2

Any thoughts in how to resolve the above issue will be greatly welcomed.

Lorena.
I suggest trying the latest CVS-snapshot and if that snapshot does not work open a bug at http://bugs.php.net
But still seems to be a linking issue, but might also be a problem with solaris sparc and php (guess it's not used or tested often)
Hernst42, thanks for all your help. I was able to finally compile it by changing the crle library path. My 500 points go to you.

Lorena.