linux/php & mssql?

admin

Administrator
Staff member
Help!
How the **** can I connect from a linux machine to an NT server running mssql?
I already tried to follow the instructions from Alberto Dainottis article, I searched throughout the forums, I tried freetds,then odbc - nothing seems to work.

I am quite new to Linux/php, and perhaps I just did something completely stupid or overlooked essential thingies...?
So here's what I did and what I got:

a) Freetds
I did just as the article said - unpacked, configured and installed the package(successfully), in my .php file that connects (wishful thinking) to the database I wrote

putenv ("SYBASE=/usr/local/freetds");
putenv ("TDSVER=50");

before the rest of the code and when calling the file in my browser, it spit out the following:

Warning: Safe Mode: Cannot set environment variable 'SYBASE' - it's not in the allowed list in /usr/local/httpd/htdocs/mssql/dbtest.php on line 3

Fatal error: Call to undefined function: mssql_connect() in /usr/local/httpd/htdocs/mssql/dbtest.php on line 6

Q1: Where do I find the "allowed list" - (whatever that may be) and how do I set the sybase variable?
Q2: How do I get rid of that undefined function error?


b)ODBC
Since my test.php file tells me that the odbc driver is up and I already connected WinNT workstations to mysql databases on the linux machine via ODBC, I assumed this might work the other way round. When calling the .php file for connecting to MSSQL my browser simply crashes (IE and NS alike).

Q3: What is the problem? I am totally dumbfounded...


Here is the configuration:

Apache 1.3.12 with PHP4 as a module running on a linux machine, freetds 5.0, MSSQL 7.0 SP2 on WINNT 4.0 SP6, odbc datasource is o.k.

I'd be VERY glad if anyone could give my a hint on what I did wrong.

:^)
skit
 
Back
Top