LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2009, 05:10 PM   #1
I_AM
Member
 
Registered: Mar 2005
Posts: 103

Rep: Reputation: 15
Exclamation script connection to mssql database problem


Have a test script with below code

Code:
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'SQL1900.mssqlservers.com';

$link = mssql_connect($server, 'username', 'password');
mssql_select_db('username', $link);
if(!$link)
{
    die('Something went wrong while connecting to MSSQL');
}
?>
Attempting to connect to another server to a MS SQL 2000 database. I installed freetds using this method below (but php -m does not output as freetds compiled):



Code:
root@server [/var/cpanel/easy/apache/rawopts]# ls -lh
total 24K
drwxr-xr-x 2 root root 4.0K Mar 20 15:50 ./
drwxr-xr-x 8 root root 4.0K Mar 20 15:52 ../
-rw-r--r-- 1 root root   32 Mar 20 15:50 all_php5
-rw-r--r-- 1 root root   32 Mar 20 15:50 Apache2_2
Those two files have this inside:

Code:
--with-mssql=/usr/local/freetds
That directory exists:

Code:
[/usr/local/freetds]# ls -lh
total 36K
drwxr-xr-x  8 root root 4.0K Mar 20 15:46 ./
drwxr-xr-x 26 root root 4.0K Mar 20 15:46 ../
drwxr-xr-x  2 root root 4.0K Mar 20 15:46 bin/
drwxr-xr-x  2 root root 4.0K Mar 20 15:46 etc/
drwxr-xr-x  2 root root 4.0K Mar 20 15:52 include/
drwxr-xr-x  2 root root 4.0K Mar 20 15:51 lib/
drwxr-xr-x  4 root root 4.0K Mar 20 15:46 man/
drwxr-xr-x  3 root root 4.0K Mar 20 15:46 share/
The test file http://www.domain.com/mssqltest.php gives off this error:
The local server is using Cpanel/Centos/PHP 5/Mysql 5. It is not using suPHP.

php -m output:

[/usr/local/freetds]# php -m
[PHP Modules]
bcmath
calendar
ctype
curl
date
dom
eAccelerator
filter
ftp
gd
gettext
hash
iconv
imap
ionCube Loader
json
libxml
mbstring
mssql
mysql
mysqli
openssl
pcre
posix
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
Zend Optimizer
zip
zlib
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Database connection using Shell Script sumitarun Linux - Newbie 2 05-09-2010 12:18 PM
Linux to read MSSQL companyweb database? anthonysaulnier Linux - Server 5 03-08-2009 12:01 AM
Connection to DB2 Database through Linux script. naren_3276 Linux - General 1 10-23-2008 07:59 AM
Accessing MSSQL database through C++ on linux using freetds nidhi Programming 2 07-07-2006 01:25 PM
Restoring MSSQL database backup into PSQL mandrivaLE2005 Linux - Software 4 01-26-2006 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration