Codeigniter3 + sql 2008 |
Hello
I use Codeigniter 3 + Sql Server 2008 I use PHP5.4 + Apache I use SQLSRV + Microsoft ODBC Driver 11 I cant connect using this code: PHP Code: $sn = "localhost"; Bad when i use codeigniter to connect, it crash Error: sqlsrv_driver line 144 Help please.
You probably need to install the Microsoft SQL Server Driver for PHP. See the PHP manual for more information: http://php.net/manual/en/book.sqlsrv.php
(05-05-2015, 08:12 AM)mwhitney Wrote: You probably need to install the Microsoft SQL Server Driver for PHP. See the PHP manual for more information: http://php.net/manual/en/book.sqlsrv.php Thanks, but i install the Microsoft SQL Server Driver (sqlsrv and pdo_sqlsrv dlls) and wiich a basic script it work but wich codeigniter dosn't. here the config and the error: Error: A PHP Error was encountered Severity: Error Message: Maximun execution time of 120 seconds excceded Filename: sqlsrv/sqlsrv_driver.php Line Number: 144 My application->config->database look like this 'dsn' => '', 'hostname' => 'localhost', 'username' => 'user', 'password' => 'password', 'database' => 'test', 'dbdriver' => 'sqlsrv',[/code]
You may want to try setting values for 'pconnect', 'char_set', and 'encrypt'. As far as I can tell, these are the only keys the sqlsrv_driver is checking other than those you already have in your config. Another possibility would be to change the 'hostname' to '127.0.0.1'.
Since the line you're getting the error message on is just the call to sqlsrv_connect(), it should be straight-forward to replicate it in an external script to test the values provided in the driver: PHP Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |