Home >Backend Development >PHP Tutorial >About the connection and use of PHP and Sybase database_PHP tutorial
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