473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PHP Sybase Extension

I would like to use PHP's Sybase extension. I am running my development
area on Windows under IIS. When I enable the Sybase extension, I get a
message that indicates the extension didn't load. After doing some digging
I have learned that in order for the Sybase extension to work
(php_sybase_ct.dll) I need libct.dll.

After Googling libct.dll and php_sybase_ct.dll and following several
threads, it appears that many people have had the same problem and come to
the same conclusion but no where did I find the information on where to
actually find libct.dll. A search of the Sybase web site didn't yield
anything either.

Can anyone enlighten me as to what I need to install and more importantly,
where to get it from in order to get past this obstacle?

Thanks,

Mike

--
Mike Walsh - mike_walsh at mindspring.com
Jul 17 '05 #1
4 8064
ljb
mi********@mindspring.com wrote:
I would like to use PHP's Sybase extension. I am running my development
area on Windows under IIS. When I enable the Sybase extension, I get a
message that indicates the extension didn't load. After doing some digging
I have learned that in order for the Sybase extension to work
(php_sybase_ct.dll) I need libct.dll.

After Googling libct.dll and php_sybase_ct.dll and following several
threads, it appears that many people have had the same problem and come to
the same conclusion but no where did I find the information on where to
actually find libct.dll. A search of the Sybase web site didn't yield
anything either.

Can anyone enlighten me as to what I need to install and more importantly,
where to get it from in order to get past this obstacle?


If you were developing on Unix/Linux, I would suggest using freetds for the
low-level library. On Windows, it might be better to use the PHP ODBC
extension instead of the PHP sybase_ct extension. Can your application use
ODBC instead? But the general answer to your question is that the low-level
library like libct.dll (or ODBC) has to come with the database software.
No, Sybase doesn't make it available separately as far as I know, and in
fact they don't even make it easy to find out how to buy it (apart from
being included in the database product). But if your Windows box can talk
to the database (with Sybase central, for example) then it already has the
low-level ODBC drivers from Sybase, and PHP should be able to use those
with the ODBC extension.
Jul 17 '05 #2

"ljb" <lj****@mindspring.com.nospam> wrote in message
news:qO*****************@newsread1.news.atl.earthl ink.net...
mi********@mindspring.com wrote:
[ ... snipped ... ]

If you were developing on Unix/Linux, I would suggest using freetds for the low-level library. On Windows, it might be better to use the PHP ODBC
extension instead of the PHP sybase_ct extension. Can your application use ODBC instead? But the general answer to your question is that the low-level library like libct.dll (or ODBC) has to come with the database software.
No, Sybase doesn't make it available separately as far as I know, and in
fact they don't even make it easy to find out how to buy it (apart from
being included in the database product). But if your Windows box can talk
to the database (with Sybase central, for example) then it already has the
low-level ODBC drivers from Sybase, and PHP should be able to use those
with the ODBC extension.


Can you elaborate on freetds? The application is developed on a Windows
environment but will be deployed on a Sun so I actually need to solve both
problems.

I have actually started looking into the ODBC solution and have been able to
create a connection via Excel so I assume I can use the same datasource for
PHP. However, I am struggling with how exactly to make this work.

I have set up an ODBC Data Source using Windows XP's Data Source (ODBC)
Control Panel utility. I am able to connect to the database without any
problem. I have given this datasource a name "Sample Data Source".

Now how would I create the proper connection with PHP? I am using PEAR DB
and did the following:

//The hostname that has the Database
define("DB_HOSTNAME", "odbc.server.com");
define("DB_PORT", "1000");

//The username and password
define("DB_USERNAME", "db_username");
define("DB_PASSWORD", "db_password");

//The DB name to use
define("DB_NAME", "sample_database");

//The DB DSN
define("DB_DSN", "odbc://" . DB_USERNAME . ":" . DB_PASSWORD . "@" .
DB_HOSTNAME . ":" . DB_PORT . "/" . DB_NAME) ;

$dbh = DB::connect(CQ_DB_DSN, true) ;

if (DB::isError($dbh))
{
die(sprintf("%s(%s): %s", basename(__FILE__), __LINE__,
$dbh->getMessage())) ;
}
else
{
print "Database connection successful." ;
}

$dbh->disconnect() ;

The values in the PHP defines are the same as those I used to create the
ODBC connection via the Windows Control Panel. Should my DSN reference the
name I used to create the ODBC connection? What would a valid DSN then look
like?

Thanks for any guidance.

Mike
--
Mike Walsh - mike_walsh at mindspring.com
Jul 17 '05 #3
ljb
mi********@mindspring.com wrote:
...
Can you elaborate on freetds? The application is developed on a Windows
environment but will be deployed on a Sun so I actually need to solve both
problems.
...


I can't help with the ODBC part because I haven't used it. I have used
freetds. Home site is http://www.freetds.org and project site is
http://sourceforge.net/projects/freetds/
This is an open-source implementation of the TDS protocol, which was
developed by Sybase and also used by Microsoft. Freetds includes 3
libraries which aim to be call-compatible with Sybase's CT-lib, DB-lib, and
ODBC library. I've found freetds to be very usable, although the developers
still consider it "alpha" test. I use freetds with the PHP sybase-ct extension.

Don't forget that there are two Sybase databases, too: ASA (a.k.a. SQL
Anywhere) and ASE. There are differences but freetds talks to both. I'm
using freetds on Linux to talk to ASA (running on Netware, if you can
believe it).
Jul 17 '05 #4
You need to get the sybase client libary (or install the client on the
webserver where php runs).

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ilya Knizhnik | last post by:
I was wondering how to connect to postgresql and sybase databases. I'm assuming that I need to recompile php with the flags for both Do I also need to install sybase and postgresql themselves...
0
by: Josh Close | last post by:
I'm getting these errors almost every time I use sybase. I'm using it with mssql. I build it like so: python setup.py build_ext -D WANT_THREADS -D HAVE_FREETDS -U WANT_BULKCOPY python setup.py...
0
by: Dave Cole | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: This...
0
by: Dave Cole | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: This...
2
by: eight02645999 | last post by:
hi i am writing a CGI to process some database transactions using the Sybase module. so in my CGI script, i have: .... import Sybase import cgitb; cgitb.enable(display=1 ,...
1
by: db2sysc | last post by:
All, We have listed out the INBUILT Function differences between Sybase and DB2. Kindly provide your feedback or corrections and for CHANGES - DO WE NEED TO CODE our own UDFs?
3
by: Alex Murphy | last post by:
As title, Thanks
0
by: =?ISO-8859-1?Q?S=E9bastien_Sabl=E9?= | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is...
0
by: =?ISO-8859-1?Q?S=E9bastien_Sabl=E9?= | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.