473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Any luck getting PHP/Linux to talk to MS SQL 2K?

Anyone having any luck to get PHP on Linux to talk to MS SQL Server
2000 via FreeTDS? Where do I begin?

I'm a Linux newbie and a PHP newbie, but I'd say I'm beyond the idiot
stage. I mean, I've written an entire PHP/MySQL app now, figured out
how to configure a dual-head monitor system on Linux by editing the
XFree86.config file, and I've been on Linux for a year. I have RH9 and
PHP 4.2.2, although I recently up2date'd, so I probably have something
later, but have no way to easily find this out.

I noticed that FreeTDS is installed on my system, as is unixODBC,
although I don't know how to use them.

BTW, we also run MS SQL 6.5 and 7, not just 2K. Do I need to be aware
of anything special with those versions?
Jul 17 '05 #1
3 3385
Hi Google Mike!

On 20 Nov 2003 13:52:47 -0800, go********@hotpop.com (Google Mike)
wrote:
Anyone having any luck to get PHP on Linux to talk to MS SQL Server
2000 via FreeTDS? Where do I begin?
http://groups.google.co.nz/groups?hl...=Google+Search
I'm a Linux newbie and a PHP newbie, but I'd say I'm beyond the idiot
stage. I mean, I've written an entire PHP/MySQL app now, figured out
how to configure a dual-head monitor system on Linux by editing the
XFree86.config file, and I've been on Linux for a year. I have RH9 and
PHP 4.2.2, although I recently up2date'd, so I probably have something
later, but have no way to easily find this out.

I noticed that FreeTDS is installed on my system, as is unixODBC,
although I don't know how to use them.

BTW, we also run MS SQL 6.5 and 7, not just 2K. Do I need to be aware
of anything special with those versions?


As far as I remember there is nothing special to get connected. Have
you checked you local firewall etc.

What does telnet sqlserverip 1433 do?

HTH, Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2
Jochen Daum <jo*********@cans.co.nz> wrote:

What does telnet sqlserverip 1433 do?


Jochen,

Hey. Thanks for your help. I did a successful telnet to several of my
NT 4 and W2K SQL Servers in my office running 6.5, 7, and 2K. For
everyone besides you and me who doesn't know this, that gets me on
port 1433, but since I don't speak the TDS language with my fingers,
it won't work, of course. It does, however, show me that my firewall
configuration is set just right on my network to enable access.

I found some FreeTDS RPMS on freetds.org and installed these
successfully.

So, I then read on the FreeTDS website how to use the command-line
command that comes with FreeTDS called tsql.

Man, that tsql command was a godsend. I immediately typed:

tsql -S ip.ip.ip.ip -H windows01 -p 1433 -U sa -P ''

You replace ip.ip.ip.ip with the IP address of the remote system. You
replace windows01 with the server name. If you have no password, you
do -P ''. Otherwise, you do -P <password>.

This got me on and I see:

1>

Press enter and I see 2>, and so on. Aha. I've seen an interface like
this before! I then typed:

use pubs
go
select * from authors
go
quit

Wow. I was able to see authors on all the 6.5, 7, and 2K servers I
have here, regardless of whether or not it was NT 4 or W2K.

Now I need to connect PHP 4.2.2 (the PHP that ships with RH9) to
FreeTDS by recompiling with the option --with-mssql=/usr/lib because
/usr/lib is where FreeTDS was installed (if I have that right).

Anyone know how to recompile PHP 4.2.2 with this option? My attempts
to download 4.2.2 and recompile have been met with trouble -- it won't
generate a make file for me. I thought this is because I have
downloaded php-4.2.2 rather than php-devel-4.2.2. Is that correct?
Jul 17 '05 #3
hI mIKE!

On 21 Nov 2003 11:03:49 -0800, go********@hotpop.com (Google Mike)
wrote:
Jochen Daum <jo*********@cans.co.nz> wrote:

What does telnet sqlserverip 1433 do?

Jochen,

Hey. Thanks for your help. I did a successful telnet to several of my
NT 4 and W2K SQL Servers in my office running 6.5, 7, and 2K. For
everyone besides you and me who doesn't know this, that gets me on
port 1433, but since I don't speak the TDS language with my fingers,
it won't work, of course. It does, however, show me that my firewall
configuration is set just right on my network to enable access.

I found some FreeTDS RPMS on freetds.org and installed these
successfully.

So, I then read on the FreeTDS website how to use the command-line
command that comes with FreeTDS called tsql.

Man, that tsql command was a godsend. I immediately typed:

tsql -S ip.ip.ip.ip -H windows01 -p 1433 -U sa -P ''


Now I'm impressed.
You replace ip.ip.ip.ip with the IP address of the remote system. You
replace windows01 with the server name. If you have no password, you
do -P ''. Otherwise, you do -P <password>.

This got me on and I see:

1>

Press enter and I see 2>, and so on. Aha. I've seen an interface like
this before! I then typed:

use pubs
go
select * from authors
go
quit

Wow. I was able to see authors on all the 6.5, 7, and 2K servers I
have here, regardless of whether or not it was NT 4 or W2K.

Now I need to connect PHP 4.2.2 (the PHP that ships with RH9) to
FreeTDS by recompiling with the option --with-mssql=/usr/lib because
/usr/lib is where FreeTDS was installed (if I have that right).

Anyone know how to recompile PHP 4.2.2 with this option? My attempts
to download 4.2.2 and recompile have been met with trouble -- it won't
generate a make file for me. I thought this is because I have
downloaded php-4.2.2 rather than php-devel-4.2.2. Is that correct?


Hmm. You need some PHP source (4.3.4 or so) and FreeTDS-dev and
whatever-dev you compile as well. Quite often the versions didn't
quite match, especially on debian, so I often also compile the other
packages from source (like FreeTDS, curl etc.)

Its then pretty straightforward. You might have to read some README's,
because some stuff needs environment variables set.

HTH, Jochen
--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: David ROBERT | last post by:
Hello, I need to read data from a MS Access database. The program (reader) is installed on a linux box and is written in python langage. The database is MS Access 2002 installed on a Win XP box...
10
by: callmebill | last post by:
I'm getting my feet wet with making Python talk to MySQL via ODBC. I started on Windows, and it went smoothly enough due to the ODBC stuff that apparently is native to Python at least on windows...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
6
by: grunes | last post by:
I wish to fread a few thousand bytes at a time in turn from several very large files from a DVD data disk, under Redhat Fedora Linux. When this is done the DVD drive wastes a lot of time and...
3
by: D Stocks | last post by:
Is it possible to have web page hosted by Linux/Apache retrieve data from (and insert data to) an MS Access database that resides on an (Internet-accessible) MS-based machine? Must the MS machine...
17
by: Nirjhar Oberoi | last post by:
Hi, I am new to Linux and wanted to know how to use GCC to Compile the Code written in C? I dont want to use EMacs or VI for my editor. Can you suggest a good IDE for linux for C Programming.. ...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
1
by: getafixx | last post by:
Hello everyone, We have a linux server (Fedora core 7, default install, firewall turned off) and a bunch of windows XP machines on network/domain. All machines are visible and I can get to both...
8
by: marknvicf | last post by:
I have read a bit about the endian differences, got a couple of jar/libs to help (Android and com.mindprod), but still am not sure how to fix this program that I have (written in JDK 1.4 by someone...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.