简体   繁体   English

无法从Codeigniter 2.1.4连接到SQL Server 2012

[英]Cannot connect to SQL Server 2012 from codeigniter 2.1.4

Warning 警告

Database Error Occurred 发生数据库错误

Unable to connect to your database server using the provided settings. 无法使用提供的设置连接到数据库服务器。

Filename: D:\\xampp\\htdocs\\214report\\system\\database\\DB_driver.php 文件名:D:\\ xampp \\ htdocs \\ 214report \\ system \\ database \\ DB_driver.php

Line Number: 124 行号:124

Source code 源代码

mmanagement/config/database.php mmanagement / config / database.php

$active_group = 'default'; $ active_group ='默认';

$active_record = TRUE; $ active_record = TRUE;

$db['default']['hostname'] = 'HOSTNAME'; $ db ['default'] ['hostname'] ='HOSTNAME';

$db['default']['username'] = 'user'; $ db ['default'] ['username'] ='user';

$db['default']['password'] = 'password'; $ db ['default'] ['password'] ='password';

$db['default']['database'] = 'Report'; $ db ['default'] ['database'] ='报告';

$db['default']['dbdriver'] = 'sqlsrv'; $ db ['default'] ['dbdriver'] ='sqlsrv';

$db['default']['dbprefix'] = ''; $ db ['default'] ['dbprefix'] ='';

$db['default']['pconnect'] = TRUE; $ db ['default'] ['pconnect'] = TRUE;

$db['default']['db_debug'] = TRUE; $ db ['default'] ['db_debug'] = TRUE;

$db['default']['cache_on'] = FALSE; $ db ['default'] ['cache_on'] = FALSE;

$db['default']['cachedir'] = ''; $ db ['default'] ['cachedir'] ='';

$db['default']['char_set'] = 'utf8'; $ db ['default'] ['char_set'] ='utf8';

$db['default']['dbcollat'] = 'utf8_general_ci'; $ db ['default'] ['dbcollat​​'] ='utf8_general_ci';

$db['default']['swap_pre'] = ''; $ db ['default'] ['swap_pre'] ='';

$db['default']['autoinit'] = TRUE; $ db ['default'] ['autoinit'] = TRUE;

$db['default']['stricton'] = FALSE; $ db ['default'] ['stricton'] = FALSE;

php.ini php.ini

extension=php_pdo_sqlsrv_54_ts.dll 扩展名= php_pdo_sqlsrv_54_ts.dll

extension=php_sqlsrv_54_ts.dll 扩展名= php_sqlsrv_54_ts.dll

Questions ? 有问题吗?

How do solve this problem ? 如何解决这个问题?

please ask to me for more source code if you need. 如果需要,请向我询问更多源代码。

1) Try seeing if all the system are requirements are met 1)尝试查看是否满足所有系统要求

2) Try to see if the Sqlserv is loaded by looking at the phpinfo(); 2)通过查看phpinfo()来尝试查看Sqlserv是否已加载;

As per the MS Site http://www.microsoft.com/en-in/download/details.aspx?id=20098 根据MS网站http://www.microsoft.com/en-in/download/details.aspx?id=20098

System Requirements /Supported Operating System for sqlserv sqlserv的系统要求/支持的操作系统

Windows 7, Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2008 Service Pack 2, Windows Vista Service Pack 2 Windows 7,Windows 8,Windows 8.1,Windows Server 2008 R2,Windows Server 2008 Service Pack 2,Windows Vista Service Pack 2

The following summarizes requirements. It will be important to see System Requirements (Microsoft Drivers for PHP for SQL Server) for more detail.

    Requires PHP 5.x. For information about how to download and install the latest stable binaries, visit http://windows.php.net for more detail.
    Version support for PHP is as follows
        Version 3.2 supports PHP 5.6, 5.5, and 5.4
        Version 3.1 supports PHP 5.5 and 5.4
        Version 3.0 supports PHP 5.4.

    For more detail and for supported operating systems, see System Requirements (Microsoft Drivers for PHP for SQL Server) .

    An Internet Information Services (IIS) Web server is required
    Versions 3.2 and 3.1 of the driver require Microsoft ODBC Driver 11 (or higher). You can download the Microsoft ODBC Driver 11 for SQL Server from the Microsoft® ODBC Driver 11 for SQL Server® - Windows page.
    Version 3.0 requires the x86 version of Microsoft SQL Server 2012 Native Client.
    Version 2.0 requires the x86 version of Microsoft SQL Server 2008 R2 Native Client.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM