Right,<br><br>Thanks to all of you for your research efforts, they give
me confidence - more importantly your quick responses have given the
management some confidence in running with an opensource product.<br><br>Regardless,
and this is slightly embarrassing but I feel I should be honest - the
issue was due to the supplying of a port number on the server string.
Odd that IIS and PHP on windows had no problem with it but regardless I
am now connected to the MSSQL server - without the use of an odbc
connection.<br>
<br>So for future reference, in order to connect to an MSSQL 2008
Express server via PHP from an Ubuntu-Server 9.10 machine you only
require the 'php5-sybase' package combined with the following connection
string.<br>
<br>"mssql_connect("192.168.1.15",<div id=":5d" class="ii gt">"username","passw0rd") or die
("Could not connect to database: ".mssql_get_last_message());"<br><br>Do
not specify the port number within the mssl_connect server string i.e.
"mssql_connect("192.168.1.15,<div>
1433","username","passw0rd") or die
("Could not connect to database: ".mssql_get_last_message());". <br><br>
It's also worth noting that I did not have to specify the database
instance i.e. SQLEXPRESS despite what various sources on tha interweb
have stated.<br><br>Thanks again for your help<br>Kind Regards,<br>Jamie.</div></div><br><br><div class="gmail_quote">On Tue, Apr 27, 2010 at 10:25 AM, Jamie McDonald <span dir="ltr"><<a href="mailto:jmack@iclebyte.com">jmack@iclebyte.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Right,<br><br>Thanks to all of you for your research efforts, they give me confidence - more importantly your quick responses have given the management some confidence in running with an opensource product.<br>
<br>Regardless, and this is slightly embarrassing but I feel I should be honest - the issue was due to the supplying of a port number on the server string. Odd that IIS and PHP on windows had no problem with it but regardless I am now connected to the MSSQL server - without the use of an odbc connection.<br>
<br>So for future reference, in order to connect to an MSSQL 2008 Express server via PHP from an Ubuntu-Server 9.10 machine you only require the 'php5-sybase' package combined with the following connection string.<br>
<br>"mssql_connect("192.168.1.15","username","passw0rd") or die
("Could not connect to database: ".mssql_get_last_message());"<br><br>Do not specify the port number within the mssl_connect server string i.e. "mssql_connect("192.168.1.15,<div>
1433","username","passw0rd") or die
("Could not connect to database: ".mssql_get_last_message());". <br><br> It's also worth noting that I did not have to specify the database
instance i.e. SQLEXPRESS despite what various sources on tha interweb
have stated.<br><br>Thanks again for your help<br>Kind Regards,<br>Jamie.<br></div><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Mon, Apr 26, 2010 at 7:54 PM, Mark Foster <span dir="ltr"><mark@foster.cc></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
<div text="#000000" bgcolor="#ffffff">
I'm almost positive you ALSO need the sybase client package(s)
installed. The php5-sybase is not a pure driver but a hook.<div><div></div><div><br>
<br>
On 04/26/2010 08:51 AM, Jamie McDonald wrote:
<blockquote type="cite">Hello all,<br>
<br>
I've just managed to convince the management to let us run Linux boxes
as our new frontend webservers - they are ubuntu-server 9.10 boxes
configured for fail over using heartbeat and DRBD.<br>
<br>
Our database servers however have remained as Microsoft SQL 2008
servers. <br>
<br>
The issue I am having is that with the testing of our webserver's I
cannot seem to connect to an MS SQL 2008 Express db server, every time
I get the error<br>
<br>
<b>"Warning</b>: mssql_connect() [<a href="http://192.168.1.61/digyourhome/function.mssql-connect" target="_blank">function.mssql-connect</a>]:
Unable to connect to server: 192.168.1.15,1433 in <b>/shared/var/www/oursite/inc/oursite_dbcon.php</b>
on line <b>2</b><br>
Could not connect to database: "<br>
<br>
The PHP code used to connect is a standard connection string i.e.<br>
<br>
"mssql_connect("192.168.1.15,1433","username","passw0rd") or die
("Could not connect to database: ".mssql_get_last_message());"<br>
<br>
The web server has has 'apt-get install php5-sybase' run on it and
apache restarted so the mssql.so object has been loaded - this is also
confirmed by its presence on the output from phpinfo();.<br>
<br>
I have disabled the firewall on the SQL2008 server - and can see the
port 1433 listening on the test sql server (my workstation) from the
webserver. I am also able to telnet to port 1433 on the SQL server from
the webserver. The username and password are also correct - I have
quadruple checked this.<br>
<br>
I've been googling all afternoon and seem to be finding conflicting
information regarding the ability of PHP to connect directly to an
MSSQL database. Some sites seem to suggest you must use a DSN via an
odbc connection but other sites suggest the old school connection
string method should work fine just as you would if using mysql. I
really don't want to start modfying the developers code, as far as I'm
concerned this codebase worked fine under windows/iis so it should run
in our new Linux environment.<br>
<br>
If anyone can give me any clarification on this issue I would be very
thankful as these servers are going to be racked this week and I do not
want to have the powers that be decide we should revert to Windows
Server / IIS.<br>
<br>
Kind Regards,<br>
Jamie.<br>
</blockquote>
<br>
<br>
</div></div><pre cols="72">--
I hate racists. Mark D. Foster <a href="mailto:mark@foster.cc" target="_blank"><mark@foster.cc></a>
<a href="http://mark.foster.cc/" target="_blank">http://mark.foster.cc/</a> | <a href="http://www.freegeekseattle.org/" target="_blank">http://www.freegeekseattle.org/</a>
</pre>
</div>
<br></div></div>--<br>
ubuntu-server mailing list<div class="im"><br>
<a href="mailto:ubuntu-server@lists.ubuntu.com" target="_blank">ubuntu-server@lists.ubuntu.com</a><br>
</div><a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-server" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-server</a><br>
More info: <a href="https://wiki.ubuntu.com/ServerTeam" target="_blank">https://wiki.ubuntu.com/ServerTeam</a><br></blockquote></div><br>
</blockquote></div><br>