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