CodeIgniter Forums
mssql 2008 with PHP 5.3.2 and CI 1.7.2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: mssql 2008 with PHP 5.3.2 and CI 1.7.2 (/showthread.php?tid=31557)

Pages: 1 2


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-23-2010

[eluser]Russell Keith[/eluser]
I have a brand new Windows 2008 R2 server running IIS7, PHP 5.3.2, MSSQL 2008, and CI 1.7.2. Can someone point me in the right direction to get the MSSQL database setup to connect? I have always used MySQL and can't get MSSQL to work at all. When I load the database class I get a lovely nondescript 500 error from IIS, when I turn the database class off the welcome page loads just fine.


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-23-2010

[eluser]Mareshal[/eluser]
I think this would help you: http://ryonsherman.blogspot.com/2009/05/mssql-extended-properties-library-for.html

Bye the way, If I were you I would go for MySQL. And, why don't you use XAMPP on windows? It has 5.3.2 Smile


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-23-2010

[eluser]Russell Keith[/eluser]
My hand is being forced by a network manager that refuses anything that is not M$. So IIS and MSSQL it is for me, yeah!!!


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-23-2010

[eluser]Russell Keith[/eluser]
[quote author="Mareshal" date="1277373357"]I think this would help you: http://ryonsherman.blogspot.com/2009/05/mssql-extended-properties-library-for.html[/quote]

This only talks about using the Extended Properties library he created, I need help getting it to work first, but it is very interesting and will keep it bookmarked for the day I get this crap working.


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-24-2010

[eluser]flaky[/eluser]
I just did a test setup to test IIS + CodeIgniter 1.7.2 + MSSQL 2008 and it worked. Can you put the database.php file here, just to check.


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-24-2010

[eluser]Russell Keith[/eluser]
[quote author="flaky" date="1277385309"]I just did a test setup to test IIS + CodeIgniter 1.7.2 + MSSQL 2008 and it worked. Can you put the database.php file here, just to check.[/quote]

I have tried a couple of things, can you post your that works? I won't be able to get to mine for a few hours.


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-24-2010

[eluser]flaky[/eluser]
Code:
$db['default']['hostname'] = "FLAKRONBYTYQI\SQL2008";
$db['default']['username'] = "sa";
$db['default']['password'] = "sa";
$db['default']['database'] = "Gallery";
$db['default']['dbdriver'] = "mssql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";



mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-24-2010

[eluser]Russell Keith[/eluser]
i didn't use server\sql2008, i was just using server as the hostname.


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-24-2010

[eluser]flaky[/eluser]
Code:
SQL2008
is my sql server instance, because I have several sql server versions installed (including sql2005)


mssql 2008 with PHP 5.3.2 and CI 1.7.2 - El Forum - 06-24-2010

[eluser]Russell Keith[/eluser]
ok I got this working as stand alone code.
Code:
$serverName = "(local)";
$connectionOptions = array("Database"=>"CI_Test", "UID"=>"test", "PWD"=>"test");
$conn = sqlsrv_connect( $serverName, $connectionOptions);
if( $conn === false )
    { die( FormatErrors( sqlsrv_errors() ) ); }

But my CI still isn't working. I tried the host name two ways.

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "GIZMO\MSSQLSERVER";
-or-
$db['default']['hostname'] = "GIZMO";

$db['default']['username'] = "test";
$db['default']['password'] = "test";
$db['default']['database'] = "CI_Test";
$db['default']['dbdriver'] = "mssql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";