467,076 Members | 960 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,076 developers. It's quick & easy.

PHP (5.1.4) MSSQL functions do not work through Apache (on Fedora Core 5)

Hi All

I'm trying to set up PHP with Microsoft SQL Server support on Fedora
Core 5. I've tried using the FreeTDS libraries, and a connect with
tsql works fine.

I've a little test PHP file that simply connects to a SQL Server
instance, executes a simple query and returns.

If I run php -f /var/www/html/testSqlServer.php it works. (I've run
it as root, a lesser user, and a very limited rights user)

If I access the same file through the browser (i.e. through Apache), it
fails giving this error message:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
server: <the_server_ipin /var/www/html/testSqlServer.php on line 7

I've rebuilt PHP multiple times, redone this system, recompiled
FreeTDS in multiple ways, recompiled PHP in multiple ways, tried yum
installs, tried other sources (dries / remi), but I cannot figure out
why this might be.

I mean, it WORKS if you run php from the command line. I've tried
giving the Apache user explicit access to the binaries, etc. Really
stumped here.

Some extra info:

FreeTDS: 0.64
PHP: 5.1.4
Fedora Core 5 Server install
Apache 2
SecureLinux is not enabled

The test file is something like this:

$con = mssql_connect("an_ip_address", "sa", "thePass");

mssql_select_db ("MYDB", $con);
$rs= mssql_query ($sql, $con);
echo "Col Val 1 is: ";
echo mssql_result ($rs, 0, 0);

mssql_close ($con);

Any ideas anyone?

Sep 18 '06 #1
  • viewed: 1127

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by bertoulin@hotmail.com | last post: by
5 posts views Thread by Grant Collins | last post: by
reply views Thread by Liza | last post: by
1 post views Thread by ptaz | last post: by
reply views Thread by Christopher | last post: by
3 posts views Thread by B Squared | last post: by
16 posts views Thread by davemateer@gmail.com | last post: by
8 posts views Thread by eugenio@iatmgu.com | last post: by
5 posts views Thread by eisenstein | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.