Click here to Skip to main content
14,733,443 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Fatal error: Call to undefined function sybase_connect() in C:\xampp\htdocs\pcgear\index.php on line 3

<?php
$link = sybase_connect('Sybase', '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!
Posted
Updated 8-Sep-11 13:45pm
v3

1 solution

This is straight out of the PHP Manual, Sybase section.


Installation
To enable Sybase-DB support configure PHP --with-sybase[=DIR]. DIR is the Sybase home directory, defaults to /home/sybase. To enable Sybase-CT support configure PHP --with-sybase-ct[=DIR]. DIR is the Sybase home directory, defaults to /home/sybase.

Note: As of PHP 5.3.0, the Sybase extension has been superseded by the sybase_ct extension and is no longer maintained. To continue using sybase you must use the sybase_ct extension.


As it says, if you are using PHP 5.3, you need to switch to sybase_ct or drop back to an older PHP.

Peter
   
Comments
Member 7751939 9-Sep-11 1:24am
   
Thanks for your kind solution. Can you let me know how to enable sybase_ct under windows7? What shall I type in the php.ini after
[Sybase-CT]?
Peter_in_2780 9-Sep-11 2:42am
   
I don't know myself. All I can suggest is poking around php.net or whatever sybase support sites you can find. Given that the error is "undefined function", it looks like a module inclusion issue.

Really dumb question. Have you restarted apache after you edited php.ini? A lot of config stuff is only read at apache startup.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900