Connect PHP to Remote SQL Server?

This is a discussion on Connect PHP to Remote SQL Server? within the PHP General forums, part of the PHP Programming Forums category; Apache and PHP 4.3.9 are on a *nix server and we don't have root access, HOWEVER we ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-06-2007
Jason Paschal
 
Posts: n/a
Default Connect PHP to Remote SQL Server?

Apache and PHP 4.3.9 are on a *nix server and we don't have root access,
HOWEVER we can have the tech support perform pretty much any action except
re-compile PHP (for which they charge), but I'm hoping i could dynamically
load extensions during run-time. I just need to know which extensions.

PHP has been compiled with unixODBC and dbx (there is no mssql extension on
the server). These look like likely tools for a SQL server connection, but
nothing works. I can't find anything about unixODBC in relation to PHP,
unless FreeTDS is mentioned as well.

I tried loading odbc.so during runtime, but it can't be found. Same for
mssql.so. Should we add these files to the extensions dir for use with
dl()? Should we install FreeTDS? Should we do both?

How can we do this without recompiling PHP?

I have the remote SQL server IP, the port number, the username and the
password. The web server IP has been added to the allow list for the SQL
Server.

Any advice will be welcome. Thanks in advance!

Leaning on the PHP list,
Jason

Reply With Quote
  #2 (permalink)  
Old 10-06-2007
mike
 
Posts: n/a
Default Re: [PHP] Connect PHP to Remote SQL Server?

On 10/5/07, Jason Paschal <jpaschal@gmail.com> wrote:
> Apache and PHP 4.3.9 are on a *nix server and we don't have root access,
> HOWEVER we can have the tech support perform pretty much any action except
> re-compile PHP (for which they charge), but I'm hoping i could dynamically
> load extensions during run-time. I just need to know which extensions.


i'd say mssql from freetds.

> I tried loading odbc.so during runtime, but it can't be found. Same for
> mssql.so. Should we add these files to the extensions dir for use with
> dl()? Should we install FreeTDS? Should we do both?


if they're not there they can't be loaded.

i would say use freetds since i've used it in the past. not sure about
what is the best nowadays for sql server 2k/etc. i used freeTDS with
php 4 to connect to mssql. i forget wihch version. maybe 6.0, maybe
7.0 if there was one?

i'm thinking there is a way for ODBC to connect but again, no clue.

> How can we do this without recompiling PHP?


i don't think you can.

note: with freetds you have to do something like putenv('TDSVER=70');
before connecting if you're having issues. you may have to google for
that too.
Reply With Quote
  #3 (permalink)  
Old 10-06-2007
Jim Lucas
 
Posts: n/a
Default Re: [PHP] Connect PHP to Remote SQL Server?

Jason Paschal wrote:
> Apache and PHP 4.3.9 are on a *nix server and we don't have root access,
> HOWEVER we can have the tech support perform pretty much any action except
> re-compile PHP (for which they charge), but I'm hoping i could dynamically
> load extensions during run-time. I just need to know which extensions.
>
> PHP has been compiled with unixODBC and dbx (there is no mssql extension on
> the server). These look like likely tools for a SQL server connection, but
> nothing works. I can't find anything about unixODBC in relation to PHP,
> unless FreeTDS is mentioned as well.
>
> I tried loading odbc.so during runtime, but it can't be found. Same for
> mssql.so. Should we add these files to the extensions dir for use with
> dl()? Should we install FreeTDS? Should we do both?
>
> How can we do this without recompiling PHP?
>
> I have the remote SQL server IP, the port number, the username and the
> password. The web server IP has been added to the allow list for the SQL
> Server.
>
> Any advice will be welcome. Thanks in advance!
>
> Leaning on the PHP list,
> Jason
>

I have seen reference to people using the sybase extension to connect to
a MSSQL server before.

Here is a reference from the php.net web site.

http://us.php.net/manual/en/ref.sybase.php#54147

Jim
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:55 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0