• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter and SQL Server

#1
Sad 
Hello ,
First of all, sniff me for my english.
I programmed a local application that works correctly with CodeIgniter 4.
The development environment is as follows:
- Apache 2.4.33
- PHP 7.0.29 Thread safe
- SQL Server 2014
During the test deployment I meet the following error:
A Database Error Occurred
Unable to connect to your database using the provided settings.
Filename: ... system / database / DB_driver.php
Line Number: 436
I did the connection tests to SQL Server and everything works fine.
But as soon as I pass on CodeIgniter there is a mistake.
The test environment is as follows:
- Plesk
- IIS
- PHP 7.0 No Thread safe
- SQL Server 2014
Thanks for your help.
Reply

#2
Are you sure it's CodeIgniter 4? v4 doesn't have a database driver for SQL Server yet, so that could be the problem.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply

#3
Escuse me, it's CodeIgniter 3 .
Reply

#4
(07-27-2018, 08:57 AM)kilishan Wrote: Are you sure it's CodeIgniter 4? v4 doesn't have a database driver for SQL Server yet, so that could be the problem.

[quote pid='356082' dateline='1532707038']
[off-topic]
When using CI4 is it possible to use the PHP NameSpace Class statement to utilise the CI 3.19 Database Drivers? 

CI3.19 Database Drivers are tried, tested and thoroughly debugged and hopefully should integrate with CI4 without a great deal of modifications.

Also if the CI 3.19 Database Drivers were included into CI4 then far more users will be able to test and report their findings.

 I have my fingers crossed Smile

[/off-topic]
[/quote]
download and make your system directory strict
Reply

#5
This is my database configuration with MSSQL server 1014.
If you using the express edition don't forget the SQLEXPRESS in the hostname!

Goog luck

Code:
$db['default'] = array(
    'dsn'    => '',
    'hostname' => 'LAPTOP-EDDOH\SQLEXPRESS',
    'port' => '1433',
    'username' => 'YOUR_USERNAME',
    'password' => 'YOUR_PASSOWORD',
    'database' => 'YOUR-DATABASENAME',
    'dbdriver' => 'sqlsrv',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.