Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS - PHP - Mac OS X Leopard Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Robert Gonzalez <robert AT robert-gonzalez.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS - PHP - Mac OS X Leopard Server
  • Date: Mon, 5 Oct 2009 11:05:11 -0700

You might need to compile the MSSQL extension with the location of FreeTDS
passed to the ./configure script. You may also have to set Apache
environment vars to know where the FreeTDS conf file is. I had to do that
when getting it set up on Ubuntu.
Not sure if it will be exactly the same for mac, but these steps are the
ones I followed to get PHP talking to MSSQL on my Ubuntu machines.

DISCLAIMER: This is a link to my blog. Seriously, I am not trying to promote
my blog. I am simply hoping to help some folks save time and stress getting
PHP to talk to SQL Server.

http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/

On Fri, Sep 25, 2009 at 7:04 AM, Nikhil <guitman423 AT gmail.com> wrote:

> Thank you for the suggestions. I was actually able to get it somewhat
> working using Entropy - it installs FreeTDS along with it. I did not
> realize
> this before and was trying to install FreeTDS along side it. However, I am
> left again with a problem connecting to the SQL server, the FreeTDS log
> shows:
> 09:32:55.683647 631 (net.c:264):tds_open_socket: connect(2) returned
> "Operation now in progress"
> 09:32:55.684355 631 (net.c:303):tds_open_socket() succeeded
> 09:32:55.684395 631 (util.c:162):Changed query state from DEAD to IDLE
> 09:32:55.684414 631 (login.c:735):quietly sending TDS 7+ login packet
> 09:32:55.684526 631 (token.c:312):tds_process_login_tokens()
> 09:32:55.686159 631 (util.c:334):tdserror(0x103d28900, 0x103d2f610, 20017,
> 0)
> 09:32:55.686188 631 (dblib.c:7782):dbperror(0x100972200, 20017, 0)
> 09:32:55.686209 631 (dblib.c:7835):20017: "Unexpected EOF from the server"
> 09:32:55.686224 631 (dblib.c:7856):"Unexpected EOF from the server", client
> returns 2 (INT_CANCEL)
> 09:32:55.686239 631 (util.c:368):tdserror: client library returned
> TDS_INT_CANCEL(2)
> 09:32:55.686254 631 (util.c:389):tdserror: returning TDS_INT_CANCEL(2)
> 09:32:55.686297 631 (util.c:162):Changed query state from IDLE to DEAD
>
> tsql connects fine, its just when I try to connect using PHP when this
> happens.
>
>
>
> On Fri, Sep 25, 2009 at 9:46 AM, Eloy Lafuente <stronk7 AT moodle.org> wrote:
>
> > I'd suggest you to use the MacPorts way:
> >
> > http://www.macports.org/
> >
> > It's a really handy "downloader/compiler/installer" for all
> > those of things, looking for dependencies, configuring...
> > lots easier than the manual way. I used to be "manual-guy"
> > until discovered it. Once intalled, something like this will
> > do the whole work:
> >
> > port install php52 +apache2 +mssql +mysql5 +postgresql83
> > (see variants for options available on each package)
> >
> > That is my current php5 port, it installs the freetds php
> > driver by default.
> >
> > Ciao, stronk7 :-)
> >
> > Daniel Fazekas escribió:
> > > On Sep 25, 2009, at 14:59, Nikhil wrote:
> > >
> > >> Does anyone have a successful FreeTDS installation with Leopard
> > >> Server? The built-in PHP module in Leopard is not configured for
> > >> MSSQL and I cannot seem to get PHP to talk with FreeTDS.
> > >
> > > You'll have to build and install the mssql php extension.
> > >
> > > First you have to get the PHP source code matching the version on your
> > > system.
> > > It's probably easiest to go to
> > > http://www.opensource.apple.com/
> > >
> > > Select the Mac OS X version you got, and look for the package named
> > > "apache_mod_php-*"
> > >
> > > Expand the archive until you get to the actual PHP source code, then
> > > it should be as simple as:
> > >
> > > cd ext/mssql
> > > phpize && ./configure && make && sudo make install
> > >
> > > Then edit /etc/php.ini to get your freshly installed extension loaded:
> > > extension = mssql.so
> > >
> > > Finally you may have to reload Apache so that the changes could take
> > > place.
> > > sudo apachectl graceful
> > >
> > >
> > > Or you could try to use the ODBC driver in FreeTDS as PHP on Mac OS X
> > > already comes with the odbc extension built in.
> > > _______________________________________________
> > > FreeTDS mailing list
> > > FreeTDS AT lists.ibiblio.org
> > > http://lists.ibiblio.org/mailman/listinfo/freetds
> > >
> >
> >
> > --
> > /// Moodle - open-source software for collaborative learning
> > ///
> > /// Free software, community, information: http://moodle.org
> > /// Commercial support and other services: http://moodle.com
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
> >
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



--

Robert Gonzalez
http://www.robert-gonzalez.com




Archive powered by MHonArc 2.6.24.

Top of Page