LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-10-2003, 06:39 AM   #1
BBPS
LQ Newbie
 
Registered: Aug 2003
Posts: 18

Rep: Reputation: 0
PHP and MSSQL


Hi,

I am fairly new to Linux, and need some help please.

I have RH9 2.4.20-8, and PHP 4.2.2 installed.

I am writing some PHP pages, to read info from some databases. I have no problem accessing data from MySQL, so that is fine. I need to access an MSSQL server we have, and before you ask I cannot move the data over to MySQL as to much relies on it already.

I have installed and configured the FreeTDS, and this works fine as I can connect to our MSSQL server on a Win2K box using the tsql command....so I know the link between Linux and the SQL Server is working.

When I try to connect to the MSSQL server in PHP I get the following error:

Fatal error: Call to undefined function: mssql_connect() in /var/www/html/test/test.php on line 11

Lince 11 of my code is: $conn=mssql_connect('MSSQLSERVER','user','password');

I have done a lot of reading, but keep going round in circles.

I believe that all I need to do is enable the option: --with-sybase=/var/local/freetds

I am not sure of the easiest way to achieve this, and I certainly don't want to change/mess up anything that is already working.

Apache and PHP were installed as part of the main install from the RH9 CD's, if that information is needed.

Can someone give me some detailed help/advice please, or point me in the right direction, the more detailed the better.

Many thanks in advance.


Paul.
 
Old 10-10-2003, 10:18 AM   #2
Hans Zarkoff
Member
 
Registered: Apr 2002
Location: Canada
Distribution: Slackware
Posts: 58

Rep: Reputation: 15
You're absolutely right. You will need to recompile php with that configure option.

You can download the source RPM if they aren't already included with your CDs. If they aren't available or whatever, you can grab the original tarball from php.net. I think you'll also need the Apache source so get that too.

I hate to suggest it, but if you have never compiled php from scratch, you may very well mess it up the first one or two times. Be sure to copy your httpd.conf and php.ini file to a safe spot in the event the installer overwrites them. If things *really* get screwed up, just reinstall your rpms and everything will be back to the way things were. Hopefully.
 
Old 10-10-2003, 10:36 AM   #3
BBPS
LQ Newbie
 
Registered: Aug 2003
Posts: 18

Original Poster
Rep: Reputation: 0
Many thanks for the information Hans.

What I may well do is setup another Linux server, and install it all from scratch, that way if I get it wrong it will be easier for me to sort out.

...or there is always the possibility of me installing PHP on one of our W******s 2K servers, but I didn't really want to have to do that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative for MSSQL paddyjoy Linux - Software 5 07-02-2005 08:53 PM
Php + Mssql + Ldap lewus Linux - Software 4 01-27-2005 02:48 AM
MySQL and MSSQL together? Manuel-H Linux - Software 3 12-10-2004 10:42 AM
RH9 + apache + php + mssql how to iel Linux - General 0 07-02-2004 04:25 AM
MySQL to MSSQL zak3 Programming 1 01-22-2004 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration