Connect Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 7 September 2009

How to connect mssql with php using FEDORA

Posted on 21:51 by Unknown

Connecting to MSSQL datbase with php from Fedora or any other Linux flovour is a pretty much easy.

In Linux Freetds Package provide libraries to connect to the MSSQL database, which can be installed with a yum command:

# yum install php-mssql

the above command asks to install MSSQL extension for PHP, but yum will take care of all the dependencies including Freetds.

Once installed you can use a low level tool like tsql which comes with Freetds to check you setup, but before that edit the Freetds config file (/etc/freetds.conf):

[root@amit]# vim /etc/freetds.conf

[MSSQL]
host = 192.168.1.1
port = 1433
tds version = 8.0

above is a simple configuration that I use to connect to SQL2005/2000 databases. The braces contain a name (any name you like) to refer to the connection from Linux, and host is the IP of the MSSQL Server, port is the port MSSQL is listening on and the tds version is the TDS Protocol Version to use when connecting with database. Now regarding the port, MAKE SURE that you are connecting to the correct MSSQL port. OK, Lets check with tsql now:

# tsql -S MSSQL -U user -P pass

that should give u a prompt like “1>”

Now check whether PHP can connect:

# php -r 'echo mssql_connect("MSSQL","user","pass");'

From the desk of Amit Maheshwari



Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • How to schedule a PHP script in task scheduler
    Quiet often there is a need to execute/run  php  script on some time interval at server side. And that php scripts should run automatically ...
  • HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to run CGI applications.
    If you get the error “HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to...
  • How to resolve Windows Login Error: "An unauthorized change was made to Windows"
    After connecting to windows server via RDC, you receive error “ An unauthorized change was made to Windows ” Resolution: 1) Click the opt...
  • Roles and Features showing an error HRESULT: 0x800F0818 in Server Manager of windows server 2008 R2
    When you open Server Manager both Roles and Features display Error and you are unable to add any role or features. When you select the det...
  • Disallowed Parent Path
    If you are unable to access the website and facing the below error: Active Server Pages error 'ASP 0131' Disallowed Parent Path /adm...
  • Reset Mysql root Password using my.ini
    Follow the below given steps to reset the Mysql root password : 1.Browse to your MySQL installation directory. 2. In there, go to "Data...
  • How to configure IIS 7 to redirect non-www domain to www domain?
    One of few legacy leftovers that was never dropped over the years is the common use of www domain prefix. It is not a problem per se for us...
  • How to upgrade Zen Cart 1.3.9 to Zen Cart 1.5
    To upgrade your Zen Cart 1.3.9 to Zen Cart 1.5, follow the following steps. (For this tutorial, I assume you are using cpanel web hosting) 1...
  • 503 This mail server requires authentication when attempting to send to a non-local e-mail address
    If you are facing the following error in receiving the emails for Plesk Webmail on Windows server: We recommend contacting the other email ...
  • Block IP from accessing website using .htaccess
    Block IP from accessing website using .htaccess To block certain ip address from accessing your website, just create a file with name .hta...

Categories

  • booting Process
  • linux
  • redhat

Blog Archive

  • ►  2013 (68)
    • ►  July (1)
    • ►  May (2)
    • ►  April (11)
    • ►  March (54)
  • ►  2012 (44)
    • ►  September (20)
    • ►  August (1)
    • ►  July (4)
    • ►  June (12)
    • ►  May (2)
    • ►  March (4)
    • ►  February (1)
  • ►  2011 (1)
    • ►  February (1)
  • ▼  2009 (9)
    • ▼  September (3)
      • How To Add a Welcome Message for SSH Users
      • How to connect mssql with php using FEDORA
      • How to Prevent Yum update of some selected package...
    • ►  August (2)
    • ►  June (1)
    • ►  May (2)
    • ►  March (1)
Powered by Blogger.

About Me

Unknown
View my complete profile