[RLUG] Help with Linux
Garrett P. Taylor
gtaylor at westerntitle.net
Mon Jul 24 12:14:29 PDT 2006
Did you ever get any resolution with this? I've successfully connected
from PHP to MS SQL on several different servers and I would happy to go
over it with you.
-----Original Message-----
From: rlug-bounces at rlug.org [mailto:rlug-bounces at rlug.org] On Behalf Of
Horalia Rodriguez
Sent: Friday, July 07, 2006 4:48 PM
To: rlug at sweetooth.org
Cc: rlug at rlug.org
Subject: Re: [RLUG] Help with Linux
Well, I got fed up with Fedora Core 5 and since your suggestion Kyle, of
using rpms involves having Fedora Core 4, I installed this version. I
downloaded both rpms but had problems installing these packages. I got
the following error messages:
[root at localhost /]# rpm -ivh freetds-0.63-2.i386.rpm
error: Failed dependencies:
libreadline.so.4 is needed by freetds-0.63-2.i386
[root at localhost /]# rpm -ivh php-mssql-5.0.4-10.1.i386.rpm
error: Failed dependencies:
libsybdb.so.5 is needed by php-mssql-5.0.4-10.1.i386
[root at localhost /]#
Do you know the correct command line to install these?
From: Kyle T. Smith <rlug at sweetooth.org>
Reply-To: rlug at sweetooth.org
To: Horalia Rodriguez <horaliar at hotmail.com>
CC: rlug at rlug.org
Subject: Re: [RLUG] Help with Linux
Date: Fri, 7 Jul 2006 12:10:00 -0800
Hi Horalia,
Ok, the error messages logged are just telling us what we already know
unfortunately. MSSQL support is correctly installed so we can eliminate
that as a source of errors. The connection strings you are using look
fine however you might want to try a couple of differant things.
Currently you have:
connect = mssql_connect("10.7.122.28,1433","user","pwd");
try chaing the server to "10.7.122.28:1433" or "10.7.122.28/1433" It is
unlikely that will make a differance.
Another thing to look into is this. Are the user and password for an SQL
user account or an Windows system account? If it is a system account you
may need to change the following option in the php.ini file from off to
on.
; Use NT authentication when connecting to the server
mssql.secure_connection = Off
If none of these things solve the problem what I would recommend is
opening the event viewer on the windows server and then trying to make
your connection. If it is having authentication or connection issues on
the windows side of things due to a php misconfiguration it should be
logged in the event viewer.
Kyle
On Fri, 07 Jul 2006 10:47:16 -0700, "Horalia Rodriguez"
<horaliar at hotmail.com> wrote:
>
> One more thing Kyle, I checked the phpinfo page as you suggested, and
the > exact same information you presented is on the phpinfo page under
the > MSSQL > section.
>
>
>
>
>
>
> From: Kyle T. Smith <rlug at sweetooth.org> > Reply-To:
rlug at sweetooth.org > To: Horalia Rodriguez <horaliar at hotmail.com>,
rlug at rlug.org > Subject: Re: [RLUG] Help with Linux > Date: Fri, 7 Jul
2006 2:13:43 -0800 > > Rpms with it pre-built, should have thought of
that...
>
> http://phprpms.sourceforge.net/mssql
>
> Also, Anna is correct in mentioning you'll want to use mssql_
functions > and > not > the odbc_ functions. While ODBC should work
in theory I've never actually > seen > it work between php and mssql.
>
> Kyle
>
> On Fri, 7 Jul 2006 01:21:04 -0700, Anna
<christiana at hipointcoffee.com> > wrote:
> > You gave a lot of good info, though without a look at your actual
> > phpinfo() output it's hard to tell.
> >
> > But, one weird thing is it seems you're attempting to use the
odbc_* > > functions? I think what you would want to use are the
mssql_* > > functions. have you read this?:
> >
> > http://us3.php.net/mssql
> >
> >
> > the php.net manual is a very good reference. it's the first place
I > > look whenever I have a question. so... do you get an error when
you > try > > to use a function like:
> >
> > <?
> > $res = mssql_connect ( 'myserver', 'usrme', 'doublesecret' ); >
> ?> > > > > I'm guessing you get an error telling you the function
mssql_connect > > isn't defined. like this:
> >
> > "Fatal error: Call to undefined function: mssql_connect() in > >
/var/www/virthosts/internaltesting.net/phpinfo.php on line 5"
> >
> > If so, that means you do not have the mssql stuff available to
your php > > apache module (it's not built in and there is no separate
module > > present). It's been a while since I've messed with
building any php > > software because I use mysql and everything just
works. It's sort of > > hard to believe but, I think you may need to
build a php module from > > scratch. Nothing pre-built-with-mssql
comes with Debian. who knows > > why? If that's true of Debian, it's
probably true of Fedora as well.
> > You might have luck at searching for an rpm.
> >
> > - Anna
> >
> >
> >
> > On Thu, Jul 06, 2006 at 04:09:33PM -0700, Horalia Rodriguez wrote:
> >> Hi Anna, thank you for responsing so soon. Here are the details
of my > >> latest attempts in getting this to work:
> >>
> >> 1. I reloaded Fedora Core 5 as a web server on the PC.
> >> 2. I installed freetds by following these steps:
> >> # rpm --import
http://dries.studentenweb.org/rpm/RPM-GPG-KEY.dries.txt
> >> -Created a file in /etc/yum.repos.d/dries.repo with the following
> > contents:
> >> [dries]
> >> name=Extra Fedora rpms dries - $releasever - $basearch > >> >
> >
baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/linux/$re
leasever/$basearch/dries/RPMS/
> >> enabled=1
> >> gpgcheck=1
> >> -I then issued the following command:
> >> # yum install freetds
> >> -After this, I tested freetds using tsql. A prompt 1> came up.
> >> 3. After installing freetds, I created the DSN to connect to the
MSSQL > >> server. Here's how I did this:
> >> -Created a file under root named tds.driver.template with the >
following > >> lines:
> >> [FreeTDS]
> >> Description = v0.63 with protocol v8.0 > >> Driver =
/usr/lib/libtdsodbc.so.0 > >> -Executed the following command, which
registers the ODBC driver:
> >> #odbcinst -i -d -f tds.driver.template > >> -Created a second
file also under root named tds.datasource.template > > with > >> the
following lines:
> >> [MSSQLTestServer]
> >> Driver = FreeTDS
> >> Description = <DB Description>
> >> Trace = No
> >> Server = <MSSQL ip address>
> >> Port = 1433
> >> Database = <DB name>
> >> -Executed the following command:
> >> # odbcinst -i -s -f tds.datasource.template -l > >> -Tested the
connection:
> >> (Copied directly from terminal window) > >> [root at localhost /]#
isql MSSQLTestServer rsm rsm > >>
+---------------------------------------+
> >> | Connected! |
> >> | |
> >> | sql-statement |
> >> | help [tablename] |
> >> | quit |
> >> | |
> >> +---------------------------------------+
> >> SQL>
> >> -I was able to successfully run a query at this point.
> >> 4. I then followed these steps that were given to me by another
person > > that > >> is trying to help me:
> >> # wget
> >>
> >
>
http://remi.collet.free.fr/rpms/fc5.i386/remi-release-1-1.fc5.remi.noarc
h.rpm
> >> # rpm -Uvh remi-release-1-1.fc5.remi.noarch.rpm
> >> # yum --enablerepo=remi install php-mssql php > >> 5. At this
point, I restarted the http service, tried to connect to > the > >>
MSSQL server which I did.
> >> 6. I created a phpinfo page, which came up successfully. I then
> checked > > the > >> configuration, and mssql is not included. I
did however find this > line:
> >> /etc/php.d/ldap.ini, /etc/php.d/mssql.ini > >> under the
additional .ini files parsed section.
> >> 7. Hoping that this was going to work, I attempted to load the >
following > >> php page, but only a blank page came up:
> >> <?php
> >> $connect = odbc_connect("MSSQLTestServer","user","pwd");
> >> if (!$connect) die ("Invalid connection"); > >> ?> > >> I
purposly used a bogus username but the error message did not come > up.
> > I
> >> then tried to use this code:
> >> <?php
> >> connect = mssql_connect("10.7.122.28,1433","user","pwd");
> >> if (!$connect) die ("Invalid connection");*/ > >> ?> > >> >
>> I also added the following lines to freetds.conf:
> >>
> >> [TDS]
> >> host = <ip address of the server with sql> > >> port = 1433 >
>> tds version = 8.0 > >> > >> I have done these steps so many
times, that I already know them by > > heart. I > >> have also
reloaded Fedora many times, so if you need me to start > fresh, > > I
> >> will do so. Any help will be appreciated, my supervisor has been
very > >> patient with me, but I know that its only a matter of time
before he > > starts > >> asking for results. The first time I
installed Fedora Core was on June > > 6th, > >> so you can see that
I've struggling with this for quite some time now.
> >>
> >> Thanks!
> >>
> >>
> >>
> >> From: Anna <christiana at hipointcoffee.com> > >> To:
rlug at rlug.org > >> CC: Horalia Rodriguez <horaliar at hotmail.com> > >>
Subject: Re: [RLUG] Help with Linux > >> Date: Thu, 6 Jul 2006
15:37:32 -0700 > >> > >> Hi Horalia.
> >>
> >> Have you run the phpinfo() function to see what you have
installed and > >> how it's configured? if not, make a php file
containing only this > line:
> >>
> >> <? phpinfo(); ?>
> >>
> >> then study the result in a web browser. if you need help
deciphering > > it, > >> post (pieces of the) the result here... or
post a url to your > phpinfo() > >> page so we can take a look.
> >>
> >> You want to start with debugging the basics. questions: is the
php > >> program you have even trying to connect to the server? is it
giving > any > >> error messages on the page or in the logs? if the
web server and db > >> server on different machines can you see any db
traffic at all moving > >> between them with packet sniffer? are
their any interesting logs on > the > >> db server?
> >>
> >> - Anna
> >>
> >>
> >> On Thu, Jul 06, 2006 at 03:24:37PM -0700, Horalia Rodriguez
wrote:
> >> >
> >> > Hi,
> >> >
> >> > Sebastian Smith suggested that I send an e-mail here to see if
I > could > >> get some > >> > help to resolve my issue. I ll be
very brief.
> >> >
> >> > I am trying to connect to a MSSQL server from a Fedora Core box
> > through > >> php. I > >> > have already successfully installed
freetds, but I can t get php to > > work.
> >> I
> >> > have installed freetds several different ways to no avail. I
believe > > that > >> it is > >> > installed correctly because I
can connect to the MSSQL server from > the > >> terminal > >> >
window and run a query successfully. I have also tried installing > php
> >> using ./ > >> > configure with-mssql= freetds-path with no
success. Could someone > > send > >> me > >> > detailed
instructions on how to do this? I m very new to Linux and > > have >
>> been > >> > struggling to get this working for the past month. I ve
been > dreaming > >> about > >> > rpms, unixODBC, php code, you
name it. I have reloaded Fedora more > > times > >> that I > >> >
care to remember, so any suggestions will be appreciated.
> >> >
> >> > Thanks,
> >> >
> >> >
> >> > Horalia Rodriguez
> >> > horaliar at hotmail.com
> >>
> >> _________________________________________________________________
> >> Don?t just search. Find. Check out the new MSN Search!
> >> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> >>
> >
> > _______________________________________________
> > RLUG mailing list
> > RLUG at rlug.org
> > http://lists.rlug.org/mailman/listinfo/rlug
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
_______________________________________________
RLUG mailing list
RLUG at rlug.org
http://lists.rlug.org/mailman/listinfo/rlug
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient (s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender via reply email and destroy all copies of the original message.
More information about the RLUG
mailing list