Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiling php with sybase - error

Status
Not open for further replies.

zum

Technical User
Mar 31, 2003
148
US
Has anyone tried to compile php with sybase configured. I keep getting this error.

I'm running RedHat Linux Enterprise 4 64bit/ php 5.2.1 and I have Sybase 12.5.2 installed.

/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libsybtcl.so when searching for -lsybtcl
/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libsybtcl.a when searching for -lsybtcl
/usr/bin/ld: cannot find -lsybtcl
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
 
Zum,

Did you resolve this issue?

If so, please post your resolution/workaround.

If not, please reply so that contributors can post suggestions.

Thanks,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
No. I have not solved this issue.

Thanks!
 
Have you made sure teh /opt/sybase/SYBASE.sh (csh) file has been run at least once during the login process. It defines some crucial environment variables. For example LD_LIBRARY_PATH.

 
Hi. Thanks for a response. I still haven't resolved this issue. Sybase is actually running, so you think I need to execute the SYBASE.sh? I've installed php and Sybase 11 on a FreeBSD server with no problems. I just can't seem to get php to compile on Linux with sybase 12.5.

What should I expect to see when I execute the SYBASE.sh?

Thanks,
 
Zum,

SYBASE.sh contains all of the "setup" for you to properly run a Sybase session.

To see the effects of SYBASE.sh:

1) log onto your machine
2) at the prompt, type "env" to see your current environment-variable settings.
3) at the prompt, type "SYBASE.sh"
4) repeat the "env" command to see how your environment-variable settings have changes.

Let us know your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Radar concurs with Mufasa. You should be able to type
cd $SYBASE/$SYBASE_OCS and wind up in the sybase ocs directory. Additionally, if you type
env |grep LD_LIBRARY_PATH
you should get something like

LD_LIBRARY_PATH=/opt/sybase/ODBC-12_5/lib:/opt/sybase/ASE-12_5/lib:/opt/sybase/OCS-12_5/lib:/opt/sybase/OCS-12_5/lib3p:

You'll note that there is a lib directory in there.
 
Thanks for both of your responses.

Here is what I get when I type: env

SYBASE_SYSAM=SYSAM-1_0
HOSTNAME=badger
SHELL=/bin/bash
TERM=vt220
HISTSIZE=1000
USER=sybase
LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib:/opt/sybase/OCS-12_5/lib3p:/opt/
sybase/SQLRemote/lib:/opt/sybase/ASE-12_5/lib:
LS_COLORS=
SYBASE_OCS=OCS-12_5
SYBASE=/opt/sybase
KDEDIR=/usr
MAIL=/var/spool/mail/sybase
PATH=/opt/sybase/OCS-12_5/bin:/opt/sybase/RPL-12_5/bin:/opt/sybase/
JS-12_5/bin:/opt/sybase/ASE-12_5/bin:/opt/sybase/ASE-12_5/instaln
INPUTRC=/etc/inputrc
PWD=/opt/sybase
LANG=en_US
LM_LICENSE_FILE=/opt/sybase/SYSAM-1_0/licenses/license.dat
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/home/sybase
SYBASE_JRE=/opt/sybase/shared-1_0/JRE-1_3
LOGNAME=sybase
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
SYBASE_ASE=ASE-12_5
_=/bin/env
OLDPWD=/opt

Here is what I get when I do a env |grep LD_LIBRARY_PATH

LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib:/opt/sybase/OCS-12_5/lib3p:/opt/
sybase/SQLRemote/lib:/opt/sybase/ASE-12_5/lib:
 
The error is actually coming up when I do the make install command. Not when I'm compiling the config file.


/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libsybtcl.so when searching for -lsybtcl

/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libsybtcl.a when searching for -lsybtcl

/usr/bin/ld: cannot find -lsybtcl collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
 
Seems to me I had this grief too. What are the options you are feeding to config? There should be a slug of them.

 
Here is my configuration. Not sure if this matters, but this is a 64 bit server and I'm installing 32-bit sybase. Should that matter?


./configure \
--prefix=/usr \
--enable-versioning \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-zlib-dir=/usr/lib64 \
--with-zlib \
--disable-cli \
--with-layout=GNU \
--disable-all \
--with-regex=php \
--with-bz2=/usr \
--with-gd \
--enable-gd \
--enable-gd-native-ttf \
--enable-gd-jis-conf \
--with-ttf \
--with-iconv=/usr/local \
--with-curl=/usr/local \
--with-config-file-path=/usr/local/apache2/conf \
--enable-ftp \
--enable-mbstring \
--without-sqlite \
--with-openssl=/usr/local \
--enable-calendar \
--enable-session \
--enable-sockets \
--enable-spl \
--enable-soap \
--enable-ctype \
--enable-libxml \
--with-libxml-dir=/usr \
--enable-xml \
--enable-memory-limit \
--with-mhash=/usr/local \
--enable-tokenizer \
--with-pdflib=/usr \
--enable-zip \
--with-mcrypt=/usr/local \
--with-jpeg-dir=/usr/local \
--with-sybase-ct=/opt/sybase/OCS-12_5 \
--with-png-dir=/usr/local
 
Probably a goofy question, but are you doing this:
./configure...
make
make install

as root?

I downloaded the latest version 5.2.2 and have sybase express 12.5.3 to test this out. I had to drop a couple of items off of your configure list, but all worked well on the compile. I did have to add a line to the /etc/init.d/httpd file to allow it to find the correct paths on startup.
. /opt/sybase/SYBASE.sh at the top of httpd.


./configure --prefix=/usr \
--enable-versioning \
--with-apxs2=/usr/sbin/apxs \
--with-zlib-dir=/usr/lib64 \
--with-zlib \
--disable-cli \
--with-layout=GNU \
--disable-all \
--with-regex=php \
--with-bz2=/usr \
--with-gd \
--enable-gd \
--enable-gd-native-ttf \
--enable-gd-jis-conf \
--with-ttf \
--with-curl=/usr/local \
--with-config-file-path=/usr/local/apache2/conf \
--enable-ftp \
--enable-mbstring \
--without-sqlite \
--with-openssl=/usr \
--enable-calendar \
--enable-session \
--enable-sockets \
--enable-spl \
--enable-soap \
--enable-ctype \
--enable-libxml \
--with-libxml-dir=/usr \
--enable-xml \
--enable-memory-limit \
--enable-tokenizer \
--with-pdflib=/usr \
--enable-zip \
--with-jpeg-dir=/usr/local \
--with-sybase-ct=/opt/sybase/OCS-12_5 \
--with-png-dir=/usr/local
 
P.S.
I missed something important in your last request. 64bit/32bit. I do not know the answer to that. I suggest going to the /opt/sybase/OCS-12_5/sample/ctlibrary/ and try to compile the samples supplied by SYBASE. If they complain as well, then you may need the 32 bit Linux or the 64 bit SYBASE.

My test was 32bit/32bit.
 
Thanks for the response. Yes I'm using root to install. So even though Sybase is running fine. The php install may crash because it's on a 64bit server and sybase is 32bit?
 
That's why I suggest compiling the sybase samples. It should verify the libraries are ok with locally compiled programs.
 
Could you give an example of how to do this. I'm still a little new at all this.

Thanks for the help.
 
Log in as sybase.

Go to the /opt/sybase/OCS-12_5/sample/ctlibrary directory.
I assume bash here.
$> export SYBPLATFORM=linux
$> make all
$> ./compute

You should get something like the following:
(I don't have the pubs database installed)
Compute Example

Server message:
Message number: 5701, Severity 10, State 2, Line 0
Server 'HSM100168'
Message String: Changed database context to 'master'.


Server message:
Message number: 911, Severity 11, State 2, Line 1
Server 'HSM100168'
Message String: Attempt to locate entry in sysdatabases for database 'pubs2' by name failed - no entry found under that name. Make sure that name is entered properly.


Server message:
Message number: 5701, Severity 10, State 1, Line 1
Server 'HSM100168'
Message String: Changed database context to 'master'.

ERROR: ex_use_db: ex_execute_cmd(use db) failed
ERROR: DoCompute: ex_use_db(pubs2) failed


This means it connected and worked properly. If it does this, I would think the 32/64 bit item is not an issue.
 
Well this can't be good. Here is what I got.

#export SYBPLATFORM=linux
# make all
sh sybopts.sh verify; \
`sh sybopts.sh compile` -I. -I/opt/sybase/OCS-12_5/include -DDEBUG -Dlinux=1 -c exutils.c -o exutils.o
SYBPLATFORM is linux

Compiling with cc -g

Sybase base libraries: -lsybtcl -lcomn -lintl
System libraries: -rdynamic -ldl -lnsl -lm
sh sybopts.sh verify; \
`sh sybopts.sh compile` -I. -I/opt/sybase/OCS-12_5/include -DDEBUG -Dlinux=1 compute.c exutils.o -L/opt/sybase/OCS-12_5/lib e SYBPLATFORM is linux
Compiling with cc -g

Sybase base libraries: -lsybtcl -lcomn -lintl
System libraries: -rdynamic -ldl -lnsl -lm

/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libct.so when searching for -lct
/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libct.a when searching for -lct
/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libcs.so when searching for -lcs
/usr/bin/ld: skipping incompatible /opt/sybase/OCS-12_5/lib/libcs.a when searching for -lcs
/usr/bin/ld: cannot find -lcs
collect2: ld returned 1 exit status
make: *** [compute] Error 1
 
Looks BAD.
Looks like the same problem. Apparently, you may need to make the 32/64 bits match. If you are a SYBASE maintenance agreement facility, you may be able to get the 64 bit version. Alternately, you can try to get a 32 bit version of Linux.

Guess that about ends the help I can give you.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top