Question: About the connection and use of PHP and Sybase database
Answer:
I am very happy to see that everyone is using Sybase. Many netizens have encountered problems when using the php_sybct.dll module of this website.
Now I will Netizens’ questions are explained as follows:
1. Pay attention to your PHP version. I only use PHP official source code (http://php.net) to compile PHP. Moreover, in PHP4, I found that
every The versions are slightly different (mainly related to ZEND), so PHP4 modules strictly distinguish PHP versions. PHP4RC1 modules cannot be used in PHP4.0.0. Some netizens use the PHP compiled version of swwwing.com company, but I can’t. Make sure you can use this
module.
2. Correctly configure your PHP, make sure your machine has only one php.ini in the traversable path of the system, and configure it correctly. Recommended
practices: Copy php_sybct.dll to the directory where php4 is located, such as c:php4. Modify php.ini (usually located in the Windows directory or
WinNT directory) in extension_dir=c:php4. Add extension=php_sybct.dll. Note that there should be no space on both sides of the = sign.
format; run php_info(); to check the PHP output information. If the sybase_ct information is found, it proves that the module is loaded successfully. Otherwise,
your PHP version does not match this module. In fact, the simplest way is to see if there is What X-Powered By... information, if there is,
then the module definitely does not match the PHP version!
3. Correctly install and configure the Sybase Client. PHP connecting to the Sybase database is not a vacuum, it requires Sybase Client
DLL support. Use SQLEDIT to add a data service to the Web database (of course, this is not necessary, you can use the existing
data service) SybWeb. After filling in the configuration parameters correctly, save and exit. Use SybasePing Tool to ensure that SybWeb service can
ping Sybase Server.
4. Write PHP code, connect to the database, use sybase_pconnect("SybWeb", "sa", "sapass"); //sapass is for sa
Connection password of the user. Sybase will prompt information such as "changed database to master...". If you want to block this information, you can add @,sybase_select_db("Your DataBase Name") before the function. @ should also be added before the function.
5. Other issues:
*About illegal operations
One of them may be related to the local machine, such as the Sybase Client is not installed correctly, or there is a problem with the Win9x system. You can transplant to WinNT
Try;
The second possibility is related to the Sybase Client version. I used SybaseCT Version 11.0.2 to compile this module. Later, some netizens
provided Version 11.9.2. I will use PHP4. Used in versions after 0.1 (inclusive). Just like MSSQL has 65 and 70, Sybase will also have version distinctions. I have sent this module to many foreign netizens, and they use it normally. I think This is because
foreigners are not as fashionable as Chinese people and use the latest version of everything.
*About the connection to Sybase under Linux or UNIX
I have not used Sybase under the two systems, so I cannot test it, but There are netizens at home and abroad who have used this module to successfully establish a connection with
Sybase for Lunix. I think they are all based on TCP/IP, which is not surprising. However, it should be noted that the SybWeb service at this time should be
Based on TCP/IP (NLWNSCK) instead of named pipe (NLMSNMP).
* About Sybase SQL Any Where
Some netizens use this module to connect to Sybase SQL Any Where, which is a miniaturized desktop-based version of Sybase The database
system may not be able to use this module.
I use Win98+Apache1.3.12+Sybase system 11(Client)+PHP4.0.0 for development;
The database is WinNT4+Sybase system11;
Web The server is Apache1.3.12 (running on WinNT) + PHP4.0.0, which is temporarily on the same computer as the database server;
has been used normally.
http://www.bkjia.com/PHPjc/532036.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532036.htmlTechArticleQ: About the connection and use of PHP and Sybase database Answer: I am very happy to see that everyone is using Sybase. Many netizens have encountered problems when using the php_sybct.dll module on this website. Now we will share their questions...