I could not connect to MSSQLSERVER 2012 |
[eluser]huangxiao[/eluser]
Hi, Can i ask some help it's been a whole week for me to configure this code igniter to connect to my MSSQLSERVER 2012...this is my configuration This is the version of my apatche 2.4.4 version of my php 5.4.16 $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = '127.0.0.1'; $db['default']['username'] = 'sa'; $db['default']['password'] = ''; $db['default']['database'] = 'lgstd'; $db['default']['dbdriver'] = 'sqlsrv'; $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'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; This is the error Call to undefined function sqlsrv_connect() in C:\wamp\www\myapps\system\database\drivers\sqlsrv\sqlsrv_driver.php on line 76 did i miss something ? Thank you in advance.
[eluser]jonez[/eluser]
The best way to solve problems like that is to Google the error message. The second search result is http://stackoverflow.com/questions/20563...rv-connect and the solution is the first answer.
[eluser]jonez[/eluser]
Same error or another? If it's the same check phpinfo() and make sure sqlsrv is loaded.
[eluser]huangxiao[/eluser]
Hi, I enabled now i tried the phpinfo(),but here comes another error Message: require_once(C:/wamp/www/vendor/system/database/drivers/sqlrv/sqlrv_driver.php): failed to open stream: No such file or directory Filename: database/DB.php Line Number: 140 Thank you in advance.
[eluser]huangxiao[/eluser]
yes, by the way here is the config $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'CARL-PC'; $db['default']['username'] = 'sa'; $db['default']['password'] = ''; $db['default']['database'] = 'dbvend'; $db['default']['dbdriver'] = 'sqlsrv'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = FALSE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; I just put the sa as default. Thank you in advance
[eluser]jonez[/eluser]
The error you posted is an include error. So either the file doesn't exist at the path listed in the message or it's a file permission issue (less likely). Can you post a screenshot of your directory structure showing that file with the path to it?
[eluser]huangxiao[/eluser]
Hi, This is the error. Unable to connect to your database server using the provided settings. Filename: C:\wamp\www\vendor\system\database\DB_driver.php Line Number: 124
[eluser]jonez[/eluser]
One of these lines is incorrect: Code: $db[‘default’][‘hostname’] = ‘127.0.0.1’; // should be your local address |
Welcome Guest, Not a member yet? Register Sign In |