Q: Connection and use of PHP and Sybase databases
A:
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 (http://php.net) 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 swwwing.com. I cannot guarantee that you can use this
Module.
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
Try;
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.