Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection problem with sqlsrv driver #11

Open
nkpin opened this issue Jun 28, 2017 · 1 comment
Open

Connection problem with sqlsrv driver #11

nkpin opened this issue Jun 28, 2017 · 1 comment

Comments

@nkpin
Copy link

nkpin commented Jun 28, 2017

Hi

I have two databases the first is MariaDB it's works.

But when I try connect to MS SQL with sqlsrv driver or pdo_sqlsrv driver cannot connect.

Do you know something about that?

This is the error

Unable to connect to your database server using the provided settings.

Filename: C:\Users\np\Documents\Proyectos\crudIgniter\system\database\DB_driver.php

Line Number: 124

And this is my config

$active_group = 'iscaffold';
$active_record = TRUE;

$db['iscaffold']['hostname'] = $_ENV['DB_HOST'];
$db['iscaffold']['hostname'] = $_ENV['DB_HOST'];
$db['iscaffold']['username'] = $_ENV['DB_USER'];
$db['iscaffold']['password'] = $_ENV['DB_PASS'];
$db['iscaffold']['database'] = $_ENV['DB_NAME'];

$db['iscaffold']['dbdriver'] = 'sqlsrv';
$db['iscaffold']['dbprefix'] = '';
$db['iscaffold']['pconnect'] = TRUE;
$db['iscaffold']['db_debug'] = TRUE;
$db['iscaffold']['cache_on'] = FALSE;
$db['iscaffold']['cachedir'] = '';
$db['iscaffold']['char_set'] = 'utf8';
$db['iscaffold']['dbcollat'] = 'utf8_general_ci';
$db['iscaffold']['swap_pre'] = '';
$db['iscaffold']['autoinit'] = TRUE;
$db['iscaffold']['stricton'] = FALSE;

And the environment is IIS 10 php 7.0.2 for windows and the driver is php_sqlsrv_7_nts_x64.dll

Thank you
Cheers

@nkpin
Copy link
Author

nkpin commented Jun 28, 2017

I fix the problem.

In the file sqlsrv_driver.php line 88 the method db_pconnect not return nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant