olie480 Posted January 29, 2009 Share Posted January 29, 2009 Hey everyone. I was wondering if anyone had a situation where their server provider disabled the PHP MSSQL module, and will not enable it for you, and your code is strictly PHP based. That is the situation I have with 1and1.com hosting. Our server in house is MSSQL, and I am trying to figure out how I can search it using PHP combined with Java, or any other technology through our website to our office database. My last resort would be ditching my PHP knowledge and trying to learn ASP.NET and get my server switched over from Linux to Windows, but I think there has to be a better way. Anyone have any solutions? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/ Share on other sites More sharing options...
trq Posted January 29, 2009 Share Posted January 29, 2009 My last resort would be ditching my PHP knowledge and trying to learn ASP.NET and get my server switched over from Linux to Windows, but I think there has to be a better way. Switch hosting provider? Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-749992 Share on other sites More sharing options...
corbin Posted January 29, 2009 Share Posted January 29, 2009 The lower-level drivers for MSSQL do not exist on linux since they were made by Microsoft (kind of simplifying it, but oh well). Things can be used in their place though, such as freetds (there are issues with using MSSQL with FreeTDS, but most people wouldn't come across the problems). But, 1and1 would have to compile the php_mssql SO manually after compiling FreeTDS. Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-750084 Share on other sites More sharing options...
matfish Posted March 11, 2009 Share Posted March 11, 2009 I have php-mssql module installed on our 1and1.com dedicated server and this works a treat when connecting to our local MSSQL in house server. I have recently changed hosting provider and installed the same module (need to install FREEtds too) but now I'm having trouble connecting when its exactly the same script. Any ideas? All firewall rules are open Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-782138 Share on other sites More sharing options...
corbin Posted March 11, 2009 Share Posted March 11, 2009 Whoa I remember this thread. Uhhh.... What error do you get? Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-782388 Share on other sites More sharing options...
matfish Posted March 12, 2009 Share Posted March 12, 2009 Thing is... I'm not getting any error messages. I have checked our MSSQL database and its giving an error: 17832 - Connection open but invalid login packets sent. I know the user/pass is correct as I'm running the same script on another server which is connecting without a problem. This only shows the echoed "Error:" and no actual error message $new = mssql_connect("[ip]:1433", "[username]", "[password]"); if($new){ echo 'connected'; } else{ echo 'Error: '; echo mssql_get_last_message(); } Any help would be appreciated. Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-783045 Share on other sites More sharing options...
corbin Posted March 12, 2009 Share Posted March 12, 2009 Try "ip,1433". I know. It sounds weird, but I can remember having to use , instead of : before. Invalid login packets..... Hrmmm.... Sounds like an issue with client library revisions maybe. Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-783269 Share on other sites More sharing options...
matfish Posted March 13, 2009 Share Posted March 13, 2009 Thanks for the reply. Changing from : to , did not make any difference. Surely I should be seeing error messages in php? Starting to pull my hair out now! I will check with our IT Dept in regards to the client libraries. If you have any other info please let me know. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-783630 Share on other sites More sharing options...
matfish Posted March 16, 2009 Share Posted March 16, 2009 putenv('TDSVER=70'); I put the above code just before the connect statement and now it works. TDS versions on the server are set to 7.0 so not sure why PHP needs this line of code in order to make the connection? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-785825 Share on other sites More sharing options...
corbin Posted March 16, 2009 Share Posted March 16, 2009 Weird.... Not sure why that did it at all. Is the server a linux server? Perhaps that affects FreeTDS. Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-786219 Share on other sites More sharing options...
matfish Posted March 17, 2009 Share Posted March 17, 2009 Yes Redhat 5 methinks with FreeTDS and php-mssql module installed. Its working and seems stable at the moment so I'm not fussed. Just didn't understand why the line of code makes it work even though the versions are set to the same on the server. Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-786574 Share on other sites More sharing options...
corbin Posted March 17, 2009 Share Posted March 17, 2009 Don't know.... Maybe FreeTDS is picky. Quote Link to comment https://forums.phpfreaks.com/topic/143004-1and1com-php-mssql-disabled-workaround/#findComment-787127 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.