note 4100 modified in ref.sybase by irc-html
| From: | irc-html@php.net | Date: | Sun, 30 Dec 2001 07:05:22 +0000 |
| Subject: | note 4100 modified in ref.sybase by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23960@lists.php.net to get a copy of this message | ||
Poor documentation on sybase support!! Here's how I made it work... First get the linux ASE
from sybase (maybe the ctlibs provided at php.net will do fine, too) Install the ASE rpm. (some
distributions don't have system libs etc in the rpm database so you might get some dependency
errors. If your systems fits the requirements install with "ignore dependencies")
Recompile php with option --with-sybase-ct=/dirtoyoursybasehome. Then you need to set the env
variable for (at least)your apache user by export SYBASE=/dirtoyoursybasehome. Now you need to set
up your servers (like DSNs for ODBC). Edit the file $SYBASE/interfaces and add your server entries:
SERVERNAME
query tcp ether 172.16.1.4 4100
master tcp ether 172.16.1.4 4100
(change IP/FQHN and port to your setup) Now you can check your config by using
$SYBASE/bin/isql -S SERVERNAME -U DBUSER -P PASSWD
If you get a prompt you have connected to your sybase! Hurray! Now you can try with php
$db=sybase_connect("SERVERNAME","DBUSER","DBPASSWD");
And... Voila!
--was--
Poor documentation on sybase support!! Here's how I made it work... First get the linux ASE
from sybase (maybe the ctlibs provided at php.net will do fine, too) Install the ASE rpm. (some
distributions don't have system libs etc in the rpm database so you might get some dependency
errors. If your systems fits the requirements install with "ignore dependencies")
Recompile php with option <PRE>--with-sybase-ct=/dirtoyoursybasehome</PRE>. Then you
need to set the env variable for (at least)your apache user by <PRE>export
SYBASE=/dirtoyoursybasehome</PRE>. Now you need to set up your servers (like DSNs for ODBC).
Edit the file $SYBASE/interfaces and add your server entries:
<PRE>
SERVERNAME
query tcp ether 172.16.1.4 4100
master tcp ether 172.16.1.4 4100
</PRE>
(change IP/FQHN and port to your setup) Now you can check your config by using
<PRE>$SYBASE/bin/isql -S SERVERNAME -U DBUSER -P PASSWD</PRE> If you get a prompt you
have connected to your sybase! Hurray! Now you can try with php
<PRE>$db=sybase_connect("SERVERNAME","DBUSER","DBPASSWD");</PRE>
And... Voila!
http://www.php.net/manual/en/ref.sybase.php