Connecting PHP to sqlserver2000 in Linux

Source: Internet
Author: User
Use php (4.x) on a Linux machine to connect to the SQL Server 2000 database apt-getinstallphp-odbcunixODBC-develunixODBC or yumins

Use php (4.x) on a Linux machine to connect to the SQL server2000 Database apt-get install php-odbc unixODBC-devel unixODBC or yum ins

Homepage → Database Technology

Background:

Read News

Connecting PHP to SQL server2000 in Linux

[Date:] Source: Linux community Author: Linux organization [Font:]

Use php (4.x) on a Linux machine to connect to the SQL server2000 Database

Apt-get install php-odbc unixODBC-devel unixODBC

Or

Yum install php-odbc unixODBC-devel unixODBC

And then from here () The current freetds source code

Cd/tmp

Wget

Tar xzvf freetds-stable.tgz

Cd freetds -*

./Configure-prefix =/usr/local/freetds-with-tdsver = 8.0-with-unixodbc =/usr

(Because SQL server2000 is connected, "-with-tdsver = 8.0" is used ")

Make; make install

Vim/usr/local/freetds/etc/tds. driver. template

Insert in file:

[FreeTDS]
Description = v0.64 with protocol v8.0
Driver =/usr/local/freetds/lib/libtdsodbc. so

(The freetds version here is 0.64)

Then install the driver

Odbcinst-I-d-f/usr/local/freetds/etc/tds. driver. template

Create a dsn.

Vim/usr/local/freetds/etc/tds. datasource. template

Content:

[MSSQLTestServer]
Driver = FreeTDS
Description = test sample database
Trace = No
Server = 192.168.1.1
Port = 1433
Database = testdb

Then

Odbcinst-I-s-f/usr/local/freetds/etc/tds. datasource. template-l

Restart apache

Now php supports connecting to the SQL Server database.

  • 0
  • In Linux, ybase cannot be started due to environment variables.

    View MySQL in Linux

    Related information: php SQL Server2000 Linux PHP

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.