Connection and use of PHP and Sybase database _ PHP Tutorial

Source: Internet
Author: User
Tags sybase client sybase database web database
Connection and use of PHP and Sybase databases. Q: Regarding the connection and use of PHP and Sybase databases, A: I'm glad to see that you are using Sybase. when using the php_sybct.dll module on this site, many netizens have encountered problems and are asking questions from netizens: connection and use of PHP and Sybase databases
We are very pleased to see that many netizens have encountered problems when using the php_sybct.dll module on this site,
Now I will explain the problems raised by netizens as follows:
1. pay attention to your PHP version, I only use PHP official source code ( to compile PHP. and, in PHP4, I found
Each version is slightly different (mainly related to ZEND), so the PHP4 module strictly distinguishes the PHP version, and the PHP4RC1 module is not
It may be used in PHP4.0.0. some netizens use the PHP compiling version of I cannot guarantee that you can use this
2. configure your PHP correctly to ensure that your machine has only one php. ini file in the system Traversal path and the configuration is correct.
Practice: copy php_sybct.dll to the directory where php4 is located, for example, c: php4. modify php. ini (usually in the Windows directory or
Extension_dir = c: php4 added extension = php_sybct.dll in the WinNT directory). Note that no space is available on both sides of the = sign.
Run php_info (); to view the PHP output information. if the sybase_ct information is found, the module is successfully loaded. otherwise
Your PHP version does not match this module. In fact, the simplest way is to see if there is any X-Powered By... information. If yes,
The module must not match the PHP version!
3. correctly install and configure the Sybase Client. it is not impossible for PHP to connect to the Sybase database. it requires Sybase Client
Support for DLL. use SQLEDIT to add a data service for the Web database (of course, this is not necessary, you can use the existing
SybWeb, enter the correct configuration parameters, save the disk and exit. use the SybasePing tool to ensure that the SybWeb service can
Ping Sybase Server.
4. write PHP code, connect to the database, and use sybase_pconnect ("SybWeb", "sa", "sapass"); // sapass for sa

The user's connection password. Sybase will prompt information such as "changed database to master...", if you want to shield these messages
You can add @ Before the function, and add @ Before the sybase_select_db ("Your DataBase Name") function @.
5. other problems:
* Illegal operations
One may be related to the local machine, such as incorrect Sybase Client installation or a problem with the Win9x system. you can port it to WinNT
The second may be related to the Sybase Client Version. I used the SybaseCT Version 11.0.2 to compile this module.
You provide Version 11.9.2. I will use it in versions later than PHP4.0.1 (inclusive), just as MSSQL has 65 and 70
In this example, Sybase has different versions. I have sent this module to many foreign users who use it normally.
It is because foreigners are not as fashionable as Chinese people and everything is up-to-date.
* Connection to Sybase in Linux or UNIX
I have not used Sybase in two systems, so I cannot test it. However, some domestic and foreign users have used this module successfully and
The connection to Sybase for Lunix is based on TCP/IP, which is not surprising. However, please note that the SybWeb service should
Based on TCP/IP (NLWNSCK) instead of named pipe (NLMSNMP ).
* About Sybase SQL Any Where
Some netizens used this module to connect to Sybase SQL Any Where, which is a small desktop-based database of Sybase.
The system may not be able to use this module.
I used Win98 + Apache1.3.12 + Sybase system 11 (Client) + PHP4.0.0 for development;
The database is WinNT4 + Sybase system11;
The Web Server is Apache1.3.12 (running in WinNT) + PHP4.0.0, and is currently on the same machine as the database Server;
Usage has been normal.

Answer: I'm glad to see that you are using Sybase. when using the php_sybct.dll module on this site, many netizens have encountered problems. now I will discuss the problems of netizens...

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.