开发者

php sybase config problem:undefined function sybase_connect() in C:\xampp\htdocs

开发者 https://www.devze.com 2023-04-03 10:55 出处:网络
Fatal error: Call to undefined functio开发者_C百科n sybase_connect() in C:\\xampp\\htdocs\\pcgear\\index.php on line 3

Fatal error: Call to undefined functio开发者_C百科n sybase_connect() in C:\xampp\htdocs\pcgear\index.php on line 3

  <?php
$link = sybase_connect('MIKE', 'sa', '')
        or die("Could not connect !");
echo "Connected successfully";
sybase_close($link);
?>

Sybase and Apache themselves work. but php can't connect to sybase

I have uncommented out extension=php_sybase_ct.dll and turn on magic_quotes_sybase = On @ c:\xampp\php\php.ini

I use Windows 7 Ultimate, xampp-win32-1.7.4-VC6-installer,sybase ase155esd2_winx86.

Please help. Thank you very much!


There can be several possibilities:

  1. First try to restart Apache and give it another try;
  2. See if php.ini file is well configured;
  3. And make sure the sybase ext has no ";" or " " information on it.

    php.ini:
    (...)
    ;extension=php_sqlite.dll
    extension=php_sybase_ct.dll
    ;extension=php_tidy.dll
    (...)</li>
    


Since sybase_connect didn't work for me, I went for odbc_connect('database', 'login', 'pw') and it worked for me.

- Windows 10 64 bits Profesional
- XAMPP 3.2.2 (12th Nov 2015)
- Sybase SQL Anywhere 8
- Inside php.ini -> "extension=php_sybase_ct.dll" without ";".
- ODBC (32bits) configured with Adaptive Server Anywhere 8.0 controler and the ODBC login has password, maybe is required*.

To configure ODBC go to: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Orígenes de datos ODBC (32 bits) or C:\WINDOWS\syswow64\odbcad32.exe

Sometimes in the Network section when configuring the ODBC you have to enable "TCP/IP" and for example write "Host=127.0.0.1" <- I sometimes forget to put "Host=" and it doesn't work at all. Make sure to press the "Test Connection" in the ODBC tab before trying to connect via PHP.

I found this old post while looking for a solution to a problem with how to connect PHP to sybase. Hope if someone finds this post, "my" solution works as for him too.

0

精彩评论

暂无评论...
验证码 换一张
取 消