Regarding Connections of sqlserver through Php

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
vinu
Forum Newbie
Posts: 1
Joined: Mon Sep 15, 2003 5:23 am

Regarding Connections of sqlserver through Php

Post by vinu »

Hello,
Our aim is to connect to sqlserver residing in a windows system from linux system through PHP.

For that We had installed freetds by downloading from http://www.freetds.com a file named freetds-0.61.tgz using the following options,
./configure --prefix=/usr/local/freetds --with tdsver=7.0 --enable-msdblib --enable-dbmfix --with gnu-ld --enable-shared --enable-static
make
make install
Then We have installed Php4.3.3 under RedHat Linux 7.2 using the dollowing options,
./configure --with-sybase=/usr/local/freetds
make
make install
Then set the environment variable SYBASE as /usr/local/freetds in /etc/profiles.
Then written a small code in php (test.php)
<html>
<body>
<h1> hi </h1>
<?php

//putenv("SYBASE=/usr/local/freetds");
putenv("TDSVER=70");
echo("Testing");
$mstest= mssql_connect ("myserver" , "nuvi" , "nuvi" );


?>
</body>
</html>

Tried loading it then returned an error message...
Fatal error: Call to undefined function: mssql_connect() in /var/www/html/test.php

Later we umcommented the putenv("SYBASE=/usr/local/freetds"); from test.php

but still the same error.

Later added /usr/local/freetds/lib in /etc/ld.so.conf file.

but still the same error.

Later in apachectl file added codes,
LD_LIBRARY_PATH=/usr/local/freetds/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
SYBASE=/usr/local/freetds; export SYBASE

but no change in error message.

In freetds.conf file
[myserver]
host=192.168.0.4
port=1433
tds version=7.0

But we are getting the same error.

Can anybody please help us to solve this problem.
my email id is vinu@amstorindia.com

with regards
vinu
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Re: Regarding Connections of sqlserver through Php

Post by xisle »

do you mean msql_connect(); ?
vinu wrote:
$mstest= mssql_connect("myserver" , "nuvi" , "nuvi" );
Post Reply