0

I must connect my Zend Framework 1.11 application with sybase 12.5.4.

I need to know how to do that from Windows 7 AND from debian 6.

I had installed sybase client on my Windows and enabled the php_sybase_ct extension (sybase_ct appears on my phpinfo), but I even could connect with sybase_connect.

The following code:

$cnn = sybase_connect('server.com.br,port', 'user', 'psw', "iso_1", 'app');
sybase_select_db('db', $cnn);

returns an error:

sybase_connect() [function.sybase-connect]: Sybase: Unable to connect in C:\wamp\www\testesybase.php on line 3

Someone can, please, help me?

I've been looking for it for a looong time!

Thank you!

Update:

Since I got sybase_connect() connect working, now my issue is: How to make Zend Framework 1.11 connect on Sybase 12.5.4?

I read that PHP uses pdo_dblib - PDO(sybase: ...) - to do that, but PHP5.3.10 on Windows doesn't have this driver anymore!

4

2 回答 2

0
    $cnn = sybase_connect('server.com.br ,port ', 'user', 'psw', "iso_1", 'app');
    

改变这个

    $cnn = sybase_connect('server.com.br', 'user', 'psw', "iso_1", 'app');
    

于 2012-07-03T13:19:27.020 回答
0

我通过使用 PDO Driver for FreeTDS让它与 Zend Framework 一起工作!

FreeTDS 安装

您需要安装php5-sybase(Sybase 连接器提供连接到 MSSQL Server 和 Sybase 所需的库)和freeTDS软件和unixODBC

要安装和配置 FreeTDS,请参阅此链接

此外,此链接提供了有关 FreeTDS 安装的良好信息。

配置连接字符串并与 Zend Framework 1.11 连接

在 上配置您的连接/etc/freetds/freetds.conf,如下所示:

[MyServer]
host = <<ip>>
port = <<port>>
# use 8.0 for newer versions of SQLSERVER
    tds version = 8.0
    # text size don't need to be such a high value, its just an example
    text size = 4294967295
    client charset = UTF-8

然后,在 Zend Framework 1.11 上,像这样配置您的连接:

;; BANCO DE DADOS LINUX
database.adapter                = PDO_MSSQL
database.params.pdoType         = dblib

database.params.host            = MyServer
database.params.dbname          = <<dbname>>
database.params.username        = <<username>>
database.params.password        = <<passwd>>
database.params.driver_options.charset = UTF-8

database.isDefaultTableAdapter  = true
于 2012-10-01T12:44:48.983 回答