473,372 Members | 1,188 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,372 software developers and data experts.

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
0 1312

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

Similar topics

by: bertoulin | last post by:
When I run my script via the shell (e.g. "php test.php") the script generates the correct output everytime. If I attempt to access the script via the web (e.g. http://localhost/test.php), Apache...
by: Grant Collins | last post by:
Hi I am writing a web based application as part of a small project that I am undertaking using servlets beans and jsp. I already have one servlet - bean - jsp page working and I have written...
by: Liza | last post by:
Hi, I run Tomcat5.0.24 on Fedora Core 1. I have two hosts defined in server.xml in a following way: <Host name ="WebTest1.something.com" debug="0" appBase="webapps" unpackWARs="true"...
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
by: Christopher | last post by:
I am running: Fedora Core 1 Python 2.4 Apache 1.3.3 mod_python 2.7.11 When I try to access the test mptest.py file I receive: > Internal Server Error
by: B Squared | last post by:
I've having a problem getting PHP to work with Apache. I've just installed Apache and on a Fedora core3 system. The installs were pretty painless, just as expected. Then I pointed to a simple web...
by: davemateer | last post by:
Hi We have a current system: Linux / Apache / PHP4.x talking to Microsoft SQL 2000 Thinking about going to: Windows 2003 / PHP4.x talking to the same Microsoft SQL 2000 box...
by: eugenio | last post by:
Hi...not sure if this is the right group for this posting, but i'm don't know where else to post. I've got a simple problem...I have a linux box running apache 2.0 and php5. I'm trying to use the...
by: eisenstein | last post by:
i read out an utf-8 xml file with greek or russian/cyrillic characters. i can display it in the browser but if i insert data into an mssql database -field is nvarchar(4000)- i only see ??? or...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...

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.