Connection and use of PHP with Sybase database

Source: Internet
Author: User
Tags php compiler php source code sybase sybase client sybase database web database
This article to share the content is PHP and Sybase database connection and use, has a certain reference value, the need for friends can refer to

Q: About the connection and use of PHP with Sybase database

Very happy to see everyone in the use of Sybase, in the use of this site Php_sybct.dll module, many netizens encountered problems,
Now the user's questions are explained as follows:

1. Note Your PHP version, I only use the official PHP source code ( to compile PHP. And, in PHP4, I found
Each version is slightly different (mainly related to Zend), so PHP4 's module strictly distinguishes PHP version, PHP4RC1 module does not
May be used in PHP4.0.0. There are netizens using the Company's PHP compiler, I cannot guarantee that you will be able to use this
2. Properly configure your PHP, ensure that your machine in the system can traverse the path of only one php.ini, and configure the correct, recommended
Practice: Copy the Php_sybct.dll to the directory where PHP4 resides, such as C:/PHP4, modify php.ini (typically located in the Windows directory or
Winnt directory) EXTENSION_DIR=C:/PHP4 add Extension=php_sybct.dll note = no space on either side
Php_info (), view PHP output information, and if sybase_ct information is found, prove that the module is successfully loaded. Otherwise, it is
Your PHP version does not match this module. In fact, the simplest way is to see if there's anything ' x-powered by ... ' Information, if any,
The module certainly does not match the PHP version!
3. Properly install and configure Sybase client side, PHP connection to Sybase database is not out of thin air, it requires Sybase client
DLL support. Use Sqledit to add a data service to the Web database (this is not necessary, of course, you can use the existing
Data service) Sybweb, after correctly filling in the configuration parameters, save the exit. Use the Sybaseping tool to ensure that the Sybweb service can
Ping through Sybase Server.
4. Write PHP code, connect to database, use Sybase_pconnect ("Sybweb", "sa", "Sapass"),//sapass for SA
User's connection password. Sybase will prompt for information such as "changed database to master ..." If you want to block these letters
sybase_select_db (the "Your DataBase Name") function should be added ' @ ' before the function.
5. Other issues:
* About illegal operation
One may be related to this machine, such as the Sybase client installation is incorrect or the Win9x system has a problem. You can transplant to Winnt.
Give it a try;
The second may be related to the Sybase client version, which I compiled with Sybasect version 11.0.2, and then a network
The friend provided version 11.9.2, which I will use later in PHP4.0.1 (including). Just like MSSQL has 65 and 701
, Sybase will also have version differentiation. This module I sent to a lot of foreign netizens, they use is very normal. I think it's because
For foreigners not as fashionable as the people, everything with the latest reason.
* Connection to Sybase under Linux or Unix
I did not use the two systems of Sybase, so can not be tested, but domestic and foreign users have used this module to establish a successful and
Connection to Sybase for LUnix. I think it's all based on TCP/IP, not surprising. However, it should be noted that the Sybweb service at this time should be
Based on TCP/IP (NLWNSCK) instead of Named Pipes (NLMSNMP).
* About Sybase SQL any Where
Users use this module to connect Sybase SQL any Where, which is a miniaturized desktop-based database of Sybase
System, you may not be able to use this module.

I use Win98+apache1.3.12+sybase system One (Client) +php4.0.0 for development;
The database is Winnt4+sybase SYSTEM11;
Web Server is Apache1.3.12 (running on Winnt) +php4.0.0, and is temporarily in the same machine as the database server;
Use has been normal.
Related recommendations:

Workaround for the text field truncated when querying SQL Server or Sybase in PHP _php tutorial

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.