Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8609949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:00:22+00:00 2026-06-12T04:00:22+00:00

I have a Linux server Debian 6, with Apache 2.2 and PHP 5.4 installed.

  • 0

I have a Linux server Debian 6, with Apache 2.2 and PHP 5.4 installed.
I need to connect my application with a MS SQL Server 2008.

My application is using Zend Framework 1.11 and charset UTF-8 (I’ll have users from all places in the world and they will put data in their own language).

FRIST, I tried to use Microsoft SQL Server ODBC driver for Linux.
It says is only for Red Hat, but I follow these instructions to install:

http://www.codesynthesis.com/~boris/blog/2011/12/02/microsoft-sql-server-odbc-driver-linux/

I could connect and make some selects on it, but I couldn’t insert data on it. I got a problem on binding parameters on pdo statements.

Insert data like the following didn’t work:

$stmt = $conn->prepare("insert into mar_regions (name) values (:name)");
$resp = $stmt->execute(array(':name' => $param));

But if I used like the this, it works:

$stmt = $conn->prepare("insert into mar_regions (name) values ('".$param."')");
$resp = $stmt->execute();

So I gave up from this driver, because my application no ZF 1.11 will not work if this.

SECOND, I try to use PDO Driver for FreeTDS. This one works ok and I could use on my ZF 1.11 application.

But then, I got one more problem: charsets.
I configure my freeTDS.conf to use UTF-8, change my tables to use NVARCHAR insted of VARCHAR and could insert utf-8 data like this:

$stmt = $dbh->prepare("insert into mar_teste (name) values (N'ンから初・配信 € зеленый банан ÀÀÀÀáááááá')");
$resp = $stmt->execute();

But, on my ZF 1.11, I can’t pass this ‘N’ attribute on querys! So my application still didn’t work.

As you can see I tried everything.

So my question is: How to connect from linux, using ZF 1.11 charset UTF-8, on MS SQL Server 2008?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:00:24+00:00Added an answer on June 12, 2026 at 4:00 am

    The answer for my question is: Use freeTDS!
    Theres a parameter for charset on it:

    [MyDSN]
        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
    

    On Zend Framework, configure your connection like this:

    ;; BANCO DE DADOS LINUX
    database.adapter                = PDO_MSSQL
    database.params.pdoType         = dblib
    
    database.params.host            = MyDSN
    database.params.dbname          = <<dbname>>
    database.params.username        = <<username>>
    database.params.password        = <<passwd>>
    database.params.driver_options.charset = UTF-8
    
    database.isDefaultTableAdapter  = true
    

    It solves the problem! 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my question. Right now I have a Linux server application (written using C++
I have Apache 2.2.16 and PHP 5.4.3 on a Linux Debian 6 x64. To
I have a linux server has an ad-hoc wireless network for clients to connect
How to send messages from php to node.js? I have a linux server running
I have recently had a linux server compromised from bots uploading .php scripts and
I have setup a git repository in a linux server, and installed the latest
I have mysql DB on cloud linux server. I am able to connect db
I have deployed the WebDav server on Debian Linux and give appropriate permission. While
I have set up WebDAv server on my Debian linux and this is working
I have a server (Linux, Debian) and my client (Windows). Currently I just copy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.