2

For our project we need to connect to an SQL server in PHP Codeigniter. Our server runs on an Linux webserver with Centos.

Normally we are common to use MYSQL to connect. For this project an SQL 2008 server already exist.

Is it possible to connect to an SQL 2008 server on such a Linux machine? And what do i need for that? Is it also possible to test the connecttion first in my Xampp dev in the local network?

2 Answers 2

2

I've had the greatest success with SQL Server connections running through ODBC drivers above anything else. Have you tried that yet?

http://technet.microsoft.com/en-us/library/hh568454.aspx

Sign up to request clarification or add additional context in comments.

Comments

0

Try-> in your application/config/database.php put the following:

// This address is valid if you're on the same domain as the server:
// If not, you can put the ip address or url here as well.
$db['default']['hostname'] = 'DBComputerName\SQLEXPRESS';
// if you need a non default port uncomment and edit
//$db['default']['port'] = '5432';
$db['default']['username'] = 'databaseUsername';
$db['default']['password'] = 'databaseenter code herePassword';
$db['default']['database'] = 'DatabaseName';
$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;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.